Skip to content

Commit afd292e

Browse files
authored
Resolve clippy lints (#3307)
1 parent 5d33dba commit afd292e

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

helix-core/src/increment/date_time.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use ropey::RopeSlice;
55

66
use std::borrow::Cow;
77
use std::cmp;
8+
use std::fmt::Write;
89

910
use super::Increment;
1011
use 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
Original file line numberDiff line numberDiff line change
@@ -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
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use helix_core::Selection;
44
use helix_dap::{self as dap, Client, Payload, Request, ThreadId};
55
use helix_lsp::block_on;
66
use log::warn;
7+
use std::fmt::Write;
78
use std::io::ErrorKind;
89
use 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)");

0 commit comments

Comments
 (0)