From fd4fd12fa3dd565b56edb395bd625b0d2ec8ad46 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Thu, 6 May 2021 17:20:00 +0900 Subject: clippy lint --- helix-term/src/ui/menu.rs | 2 +- helix-term/src/ui/prompt.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'helix-term/src/ui') diff --git a/helix-term/src/ui/menu.rs b/helix-term/src/ui/menu.rs index 30ac044c..f8f6f269 100644 --- a/helix-term/src/ui/menu.rs +++ b/helix-term/src/ui/menu.rs @@ -258,7 +258,7 @@ impl Component for Menu { let win_height = area.height as usize; - fn div_ceil(a: usize, b: usize) -> usize { + const fn div_ceil(a: usize, b: usize) -> usize { (a + b - 1) / a } diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 04108d79..c59a0eed 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -31,8 +31,8 @@ impl Prompt { prompt: String, mut completion_fn: impl FnMut(&str) -> Vec + 'static, callback_fn: impl FnMut(&mut Editor, &str, PromptEvent) + 'static, - ) -> Prompt { - Prompt { + ) -> Self { + Self { prompt, line: String::new(), cursor: 0, -- cgit v1.2.3-70-g09d2