on master help sign in
Resolve clippy lints (#3307)
afd292eOmnikar
helix-core/src/increment/date_time.rs+2−1
@@ -5,6 +5,7 @@ use ropey::RopeSlice;
5
5
6use std::borrow::Cow;
6use std::borrow::Cow;
7use std::cmp;
7use std::cmp;
8+use std::fmt::Write;
8
9
9use super::Increment;
10use super::Increment;
10use crate::{Range, Tendril};
11use crate::{Range, Tendril};
@@ -162,7 +163,7 @@ impl Format {
162 fields.push(field);
163 fields.push(field);
163 max_len += field.max_len + remaining[..i].len();
164 max_len += field.max_len + remaining[..i].len();
164 regex += &remaining[..i];
165 regex += &remaining[..i];
165− regex += &format!("({})", field.regex);
166+ write!(regex, "({})", field.regex).unwrap();
166 remaining = &after[spec_len..];
167 remaining = &after[spec_len..];
167 }
168 }
168
169
helix-term/src/ui/editor.rs+1−1
@@ -1011,7 +1011,7 @@ impl EditorView {
1011 None => return EventResult::Ignored(None),
1011 None => return EventResult::Ignored(None),
1012 }
1012 }
1013
1013
1014− let offset = config.scroll_lines.abs() as usize;
1014+ let offset = config.scroll_lines.unsigned_abs();
1015 commands::scroll(cxt, offset, direction);
1015 commands::scroll(cxt, offset, direction);
1016
1016
1017 cxt.editor.tree.focus = current_view;
1017 cxt.editor.tree.focus = current_view;
helix-view/src/handlers/dap.rs+3−2
@@ -4,6 +4,7 @@ use helix_core::Selection;
4use helix_dap::{self as dap, Client, Payload, Request, ThreadId};
4use helix_dap::{self as dap, Client, Payload, Request, ThreadId};
5use helix_lsp::block_on;
5use helix_lsp::block_on;
6use log::warn;
6use log::warn;
7+use std::fmt::Write;
7use std::io::ErrorKind;
8use std::io::ErrorKind;
8use std::path::PathBuf;
9use std::path::PathBuf;
9
10
@@ -180,10 +181,10 @@ impl Editor {
180
181
181 let mut status = format!("{} stopped because of {}", scope, reason);
182 let mut status = format!("{} stopped because of {}", scope, reason);
182 if let Some(desc) = description {
183 if let Some(desc) = description {
183− status.push_str(&format!(" {}", desc));
184+ write!(status, " {}", desc).unwrap();
184 }
185 }
185 if let Some(text) = text {
186 if let Some(text) = text {
186− status.push_str(&format!(" {}", text));
187+ write!(status, " {}", text).unwrap();
187 }
188 }
188 if all_threads_stopped {
189 if all_threads_stopped {
189 status.push_str(" (all threads stopped)");
190 status.push_str(" (all threads stopped)");