Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
zbraniecki committed Oct 1, 2019
1 parent b6a7e93 commit fcfb35e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions unic-langid-impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ readme = "README.md"
repository = "https://github.com/zbraniecki/unic-locale"
license = "MIT/Apache-2.0"
categories = ["internationalization"]
exclude = ["data/**/*.json"]

[dependencies]
tinystr = "0.3"
Expand Down
3 changes: 1 addition & 2 deletions unic-langid-impl/src/bin/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ fn main() {
(val_lang, val_script, val_region),
)),
_ => {
println!("{:#?}", key_langid);
panic!()
panic!("{:#?}", key_langid);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions unic-langid-impl/src/likelysubtags/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ fn get_lang_from_parts(
script: Option<TinyStr4>,
region: Option<TinyStr4>,
) -> Option<(Option<TinyStr8>, Option<TinyStr4>, Option<TinyStr4>)> {
let lang = unsafe { lang.or_else(|| input.0.map(|l| TinyStr8::new_unchecked(l))) };
let script = unsafe { script.or_else(|| input.1.map(|s| TinyStr4::new_unchecked(s))) };
let region = unsafe { region.or_else(|| input.2.map(|r| TinyStr4::new_unchecked(r))) };
let lang = lang.or_else(|| input.0.map(|l| unsafe { TinyStr8::new_unchecked(l) }));
let script = script.or_else(|| input.1.map(|s| unsafe { TinyStr4::new_unchecked(s) }));
let region = region.or_else(|| input.2.map(|r| unsafe { TinyStr4::new_unchecked(r) }));
Some((lang, script, region))
}

Expand Down

0 comments on commit fcfb35e

Please sign in to comment.