diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/eval.rs | 4 | ||||
| -rw-r--r-- | src/main.rs | 12 | ||||
| -rw-r--r-- | src/parser.rs | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/eval.rs b/src/eval.rs index beda22b..7fa3408 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -15,10 +15,10 @@ fn int_to_float(i: &BigInt) -> f64 { let mut fraction; if exponent <= 52 { // The number can be represented exactly without rounding. - fraction = i.to_u64().unwrap() << 52 - exponent; + fraction = i.to_u64().unwrap() << (52 - exponent); } else { // We need to round. - let power = BigInt::from(1) << exponent - 52; + let power = BigInt::from(1) << (exponent - 52); let (rounded_fraction, rem) = i.div_rem(&power); fraction = rounded_fraction.to_u64().unwrap(); let half = power >> 1; diff --git a/src/main.rs b/src/main.rs index a372735..4352351 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,8 +58,12 @@ fn main() -> ExitCode { }); let key_controller = EventControllerKey::new(); - key_controller.connect_key_released( - clone!(@weak window, @weak input => move |_, k, _, modifiers| { + key_controller.connect_key_released(clone!( + #[weak] + window, + #[weak] + input, + move |_, k, _, modifiers| { if k == Key::Escape || k == Key::Return || k == Key::bracketleft && modifiers.contains(ModifierType::CONTROL_MASK) @@ -68,8 +72,8 @@ fn main() -> ExitCode { } *mailbox.lock().unwrap() = input.text().to_string(); let _ = flag_send.try_send(()); - }), - ); + } + )); window.add_controller(key_controller); window.present(); diff --git a/src/parser.rs b/src/parser.rs index 19e8e47..b415aa1 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -151,7 +151,7 @@ fn prec(op: BinOp) -> i8 { } } -impl<'a> Parser<'a> { +impl Parser<'_> { fn flush(&mut self, target_prec: i8) { loop { match self.stack.last() { |
