Skip to content

Commit d608894

Browse files
authored
Apply cargo fmt and clippy (#308)
1 parent 4370cf4 commit d608894

File tree

6 files changed

+21
-18
lines changed

6 files changed

+21
-18
lines changed

fluent-bundle/benches/resolver.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ fn add_functions<R>(name: &'static str, bundle: &mut FluentBundle<R>) {
6161
match name {
6262
"preferences" => {
6363
bundle
64-
.add_function("PLATFORM", |_args, _named_args| {
65-
"linux".into()
66-
})
64+
.add_function("PLATFORM", |_args, _named_args| "linux".into())
6765
.expect("Failed to add a function to the bundle.");
6866
}
6967
_ => {}

fluent-bundle/benches/resolver_iai.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ fn add_functions<R>(name: &'static str, bundle: &mut FluentBundle<R>) {
88
match name {
99
"preferences" => {
1010
bundle
11-
.add_function("PLATFORM", |_args, _named_args| {
12-
"linux".into()
13-
})
11+
.add_function("PLATFORM", |_args, _named_args| "linux".into())
1412
.expect("Failed to add a function to the bundle.");
1513
}
1614
_ => {}

fluent-bundle/examples/functions.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ fn main() {
1616

1717
// Test for a simple function that returns a string
1818
bundle
19-
.add_function("HELLO", |_args, _named_args| {
20-
"I'm a function!".into()
21-
})
19+
.add_function("HELLO", |_args, _named_args| "I'm a function!".into())
2220
.expect("Failed to add a function to the bundle.");
2321

2422
// Test for a function that accepts unnamed positional arguments

fluent-bundle/tests/resolver_fixtures.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,17 +268,26 @@ fn test_test(test: &Test, defaults: &Option<TestDefaults>, mut scope: Scope) {
268268
scope.get_path()
269269
);
270270
} else if let Some(ref expected_value) = assert.value {
271-
let msg = bundle.get_message(&assert.id).unwrap_or_else(|| panic!("Failed to retrieve message `{}` in {}.",
272-
&assert.id,
273-
scope.get_path()));
271+
let msg = bundle.get_message(&assert.id).unwrap_or_else(|| {
272+
panic!(
273+
"Failed to retrieve message `{}` in {}.",
274+
&assert.id,
275+
scope.get_path()
276+
)
277+
});
274278
let val = if let Some(ref attr) = assert.attribute {
275279
msg.get_attribute(attr.as_str())
276-
.unwrap_or_else(|| panic!("Failed to retrieve an attribute of a message {}.{}.",
277-
assert.id, attr))
280+
.unwrap_or_else(|| {
281+
panic!(
282+
"Failed to retrieve an attribute of a message {}.{}.",
283+
assert.id, attr
284+
)
285+
})
278286
.value()
279287
} else {
280-
msg.value().unwrap_or_else(|| panic!("Failed to retrieve a value of a message {}.",
281-
assert.id))
288+
msg.value().unwrap_or_else(|| {
289+
panic!("Failed to retrieve a value of a message {}.", assert.id)
290+
})
282291
};
283292

284293
let args: Option<FluentArgs> = assert.args.as_ref().map(|args| {

fluent-fallback/src/pin_cell/pin_mut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ impl<'a, T: ?Sized> Deref for PinMut<'a, T> {
1313
type Target = T;
1414

1515
fn deref(&self) -> &T {
16-
&*self.inner
16+
&self.inner
1717
}
1818
}
1919

fluent-fallback/src/pin_cell/pin_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ impl<'a, T: ?Sized> Deref for PinRef<'a, T> {
1313
type Target = T;
1414

1515
fn deref(&self) -> &T {
16-
&*self.inner
16+
&self.inner
1717
}
1818
}
1919

0 commit comments

Comments
 (0)