Skip to content

Commit d8af5c8

Browse files
committed
cargo fmt
1 parent 3dd2257 commit d8af5c8

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

benches/lib.rs

+19-15
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ fn bench_simple_format(b: &mut Bencher) {
4343
let mut ctx = MessageContext::new(&["x-testing"]);
4444
ctx.add_messages(&source);
4545

46-
b.iter(|| for id in &ids {
47-
if let Some(message) = ctx.get_message(id.as_str()) {
48-
let _value = ctx.format(message, None);
46+
b.iter(|| {
47+
for id in &ids {
48+
if let Some(message) = ctx.get_message(id.as_str()) {
49+
let _value = ctx.format(message, None);
50+
}
4951
}
5052
});
5153
}
@@ -74,18 +76,20 @@ fn bench_menubar_format(b: &mut Bencher) {
7476
let mut ctx = MessageContext::new(&["x-testing"]);
7577
ctx.add_messages(&source);
7678

77-
b.iter(|| for id in &ids {
78-
// In real-life usage we'd have different fallback strategies for missing messages
79-
// depending on the type of the widget this message was supposed to translate. Some
80-
// widgets may only expect attributes and they shouldn't be forced to display a value.
81-
// Here however it doesn't matter because we know for certain that the message for `id`
82-
// exists.
83-
if let Some(message) = ctx.get_message(id.as_str()) {
84-
let _value = ctx.format(message, None);
85-
86-
if let Some(ref attributes) = message.attributes {
87-
for attr in attributes {
88-
let _value = ctx.format(attr, None);
79+
b.iter(|| {
80+
for id in &ids {
81+
// In real-life usage we'd have different fallback strategies for missing messages
82+
// depending on the type of the widget this message was supposed to translate. Some
83+
// widgets may only expect attributes and they shouldn't be forced to display a value.
84+
// Here however it doesn't matter because we know for certain that the message for `id`
85+
// exists.
86+
if let Some(message) = ctx.get_message(id.as_str()) {
87+
let _value = ctx.format(message, None);
88+
89+
if let Some(ref attributes) = message.attributes {
90+
for attr in attributes {
91+
let _value = ctx.format(attr, None);
92+
}
8993
}
9094
}
9195
}

src/resolve.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,13 @@ impl ResolveValue for ast::Expression {
173173
}
174174

175175
match pattern.elements.first() {
176-
Some(
177-
&ast::PatternElement::Placeable(ast::Placeable {
178-
expression:
179-
ast::Expression::SelectExpression {
180-
expression: None,
181-
ref variants,
182-
},
183-
}),
184-
) => Some(variants),
176+
Some(&ast::PatternElement::Placeable(ast::Placeable {
177+
expression:
178+
ast::Expression::SelectExpression {
179+
expression: None,
180+
ref variants,
181+
},
182+
})) => Some(variants),
185183
_ => None,
186184
}
187185
});

0 commit comments

Comments
 (0)