on master help sign in
Resolve clippy lints (#3307)
commitafd292e3b9616ea9098ca3a7d24a730508b84809 authorOmnikar <omnikar5@gmail.com> dateThu 4 Aug 2022, 01:32 (4 years ago) parent5d33dba
3 files changed+6−4
helix-core/src/increment/date_time.rs+2−1 helix-term/src/ui/editor.rs+1−1 helix-view/src/handlers/dap.rs+3−2
helix-core/src/increment/date_time.rs+2−1
@@ -5,6 +5,7 @@ use ropey::RopeSlice;
55
66use std::borrow::Cow;
77use std::cmp;
8+use std::fmt::Write;
89
910use super::Increment;
1011use crate::{Range, Tendril};
@@ -162,7 +163,7 @@ impl Format {
162163 fields.push(field);
163164 max_len += field.max_len + remaining[..i].len();
164165 regex += &remaining[..i];
165− regex += &format!("({})", field.regex);
166+ write!(regex, "({})", field.regex).unwrap();
166167 remaining = &after[spec_len..];
167168 }
168169
helix-term/src/ui/editor.rs+1−1
@@ -1011,7 +1011,7 @@ impl EditorView {
10111011 None => return EventResult::Ignored(None),
10121012 }
10131013
1014− let offset = config.scroll_lines.abs() as usize;
1014+ let offset = config.scroll_lines.unsigned_abs();
10151015 commands::scroll(cxt, offset, direction);
10161016
10171017 cxt.editor.tree.focus = current_view;
helix-view/src/handlers/dap.rs+3−2
@@ -4,6 +4,7 @@ use helix_core::Selection;
44use helix_dap::{self as dap, Client, Payload, Request, ThreadId};
55use helix_lsp::block_on;
66use log::warn;
7+use std::fmt::Write;
78use std::io::ErrorKind;
89use std::path::PathBuf;
910
@@ -180,10 +181,10 @@ impl Editor {
180181
181182 let mut status = format!("{} stopped because of {}", scope, reason);
182183 if let Some(desc) = description {
183− status.push_str(&format!(" {}", desc));
184+ write!(status, " {}", desc).unwrap();
184185 }
185186 if let Some(text) = text {
186− status.push_str(&format!(" {}", text));
187+ write!(status, " {}", text).unwrap();
187188 }
188189 if all_threads_stopped {
189190 status.push_str(" (all threads stopped)");