diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-05-21 17:29:59 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-05-28 11:54:59 +0000 |
| commit | 7b82c66f0aea7e4d350c06f3624d641859b837e2 (patch) | |
| tree | 30e8888ce9f293d2e7213bfd583942ce565044e1 /android | |
| parent | c10d566a7bd5c784bbfc1aec414638ff149d2284 (diff) | |
| download | mullvadvpn-7b82c66f0aea7e4d350c06f3624d641859b837e2.tar.xz mullvadvpn-7b82c66f0aea7e4d350c06f3624d641859b837e2.zip | |
Move `match_str!` macro to a separate module
Diffstat (limited to 'android')
| -rw-r--r-- | android/translations-converter/src/gettext/match_str.rs | 16 | ||||
| -rw-r--r-- | android/translations-converter/src/gettext/mod.rs | 19 |
2 files changed, 18 insertions, 17 deletions
diff --git a/android/translations-converter/src/gettext/match_str.rs b/android/translations-converter/src/gettext/match_str.rs new file mode 100644 index 0000000000..30733cbcd3 --- /dev/null +++ b/android/translations-converter/src/gettext/match_str.rs @@ -0,0 +1,16 @@ +/// A helper macro to match a string to various prefix and suffix combinations. +macro_rules! match_str { + ( + ( $string:expr ) + $( [$start:expr, $middle:ident, $end:expr] => $body:tt )* + _ => $else:expr $(,)* + ) => { + $( + if let Some($middle) = parse_line($string, $start, $end) { + $body + } else + )* { + $else + } + }; +} diff --git a/android/translations-converter/src/gettext/mod.rs b/android/translations-converter/src/gettext/mod.rs index 1bed501b72..e0ac141082 100644 --- a/android/translations-converter/src/gettext/mod.rs +++ b/android/translations-converter/src/gettext/mod.rs @@ -1,3 +1,5 @@ +#[macro_use] +mod match_str; mod msg_string; mod plural_form; @@ -35,23 +37,6 @@ pub enum MsgValue { }, } -/// A helper macro to match a string to various prefix and suffix combinations. -macro_rules! match_str { - ( - ( $string:expr ) - $( [$start:expr, $middle:ident, $end:expr] => $body:tt )* - _ => $else:expr $(,)* - ) => { - $( - if let Some($middle) = parse_line($string, $start, $end) { - $body - } else - )* { - $else - } - }; -} - impl Translation { /// Load message entries from a gettext translation file. /// |
