Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zbraniecki committed Jul 31, 2020
1 parent f589e62 commit 6175bf4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions components/pluralrules/src/bin/generate_res.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ use std::io::prelude::*;

fn main() {
{
let res = unsafe { get_resource(PluralRuleType::Cardinal).expect("Failed to retrieve resource.") };
let res = unsafe {
get_resource(PluralRuleType::Cardinal).expect("Failed to retrieve resource.")
};
let encoded: Vec<u8> = bincode::serialize(&res).expect("Failed to serialize to bincode.");
let mut buffer = File::create("./data/plurals.dat").expect("Opening file failed");
buffer.write_all(&encoded).expect("Writing failed");
}
{
let res = unsafe { get_resource(PluralRuleType::Ordinal).expect("Failed to retrieve resource.") };
let res =
unsafe { get_resource(PluralRuleType::Ordinal).expect("Failed to retrieve resource.") };
let encoded: Vec<u8> = bincode::serialize(&res).expect("Failed to serialize to bincode.");
let mut buffer = File::create("./data/ordinals.dat").expect("Opening file failed");
buffer.write_all(&encoded).expect("Writing failed");
Expand Down
5 changes: 4 additions & 1 deletion components/pluralrules/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@ impl PluralRules {
let selector = data_provider
.get_selector(&locale, type_)?
.ok_or(PluralRulesError::MissingData)?;
Ok(Self { _locale: locale, selector })
Ok(Self {
_locale: locale,
selector,
})
}

/// Returns the [`Plural Category`] appropriate for the given number.
Expand Down

0 comments on commit 6175bf4

Please sign in to comment.