mirror of
https://github.com/agersant/polaris
synced 2024-11-10 10:14:12 +00:00
move match macro into utils module
This commit is contained in:
parent
1ff845d48e
commit
943174bafa
2 changed files with 12 additions and 9 deletions
|
@ -14,15 +14,7 @@ use opus_headers;
|
|||
use crate::utils;
|
||||
use crate::utils::AudioFormat;
|
||||
|
||||
macro_rules! match_ignore_case {
|
||||
(match $v:ident {
|
||||
$( $lit:literal => $res:expr, )*
|
||||
_ => $catch_all:expr $(,)?
|
||||
}) => {{
|
||||
$( if $lit.eq_ignore_ascii_case(&$v) { $res } else )*
|
||||
{ $catch_all }
|
||||
}};
|
||||
}
|
||||
use crate::match_ignore_case;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct SongTags {
|
||||
|
|
11
src/utils.rs
11
src/utils.rs
|
@ -3,6 +3,17 @@ use app_dirs::{app_root, AppDataType, AppInfo};
|
|||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! match_ignore_case {
|
||||
(match $v:ident {
|
||||
$( $lit:literal => $res:expr, )*
|
||||
_ => $catch_all:expr $(,)?
|
||||
}) => {{
|
||||
$( if $lit.eq_ignore_ascii_case(&$v) { $res } else )*
|
||||
{ $catch_all }
|
||||
}};
|
||||
}
|
||||
|
||||
#[cfg(target_family = "windows")]
|
||||
const APP_INFO: AppInfo = AppInfo {
|
||||
name: "Polaris",
|
||||
|
|
Loading…
Reference in a new issue