Skip to content

Commit

Permalink
Resolve clippy lints (helix-editor#3307)
Browse files Browse the repository at this point in the history
  • Loading branch information
Omnikar authored and thomasskk committed Sep 9, 2022
1 parent 2b409da commit fbdc58e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion helix-core/src/increment/date_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use ropey::RopeSlice;

use std::borrow::Cow;
use std::cmp;
use std::fmt::Write;

use super::Increment;
use crate::{Range, Tendril};
Expand Down Expand Up @@ -162,7 +163,7 @@ impl Format {
fields.push(field);
max_len += field.max_len + remaining[..i].len();
regex += &remaining[..i];
regex += &format!("({})", field.regex);
write!(regex, "({})", field.regex).unwrap();
remaining = &after[spec_len..];
}

Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ impl EditorView {
None => return EventResult::Ignored(None),
}

let offset = config.scroll_lines.abs() as usize;
let offset = config.scroll_lines.unsigned_abs();
commands::scroll(cxt, offset, direction);

cxt.editor.tree.focus = current_view;
Expand Down
5 changes: 3 additions & 2 deletions helix-view/src/handlers/dap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use helix_core::Selection;
use helix_dap::{self as dap, Client, Payload, Request, ThreadId};
use helix_lsp::block_on;
use log::warn;
use std::fmt::Write;
use std::io::ErrorKind;
use std::path::PathBuf;

Expand Down Expand Up @@ -180,10 +181,10 @@ impl Editor {

let mut status = format!("{} stopped because of {}", scope, reason);
if let Some(desc) = description {
status.push_str(&format!(" {}", desc));
write!(status, " {}", desc).unwrap();
}
if let Some(text) = text {
status.push_str(&format!(" {}", text));
write!(status, " {}", text).unwrap();
}
if all_threads_stopped {
status.push_str(" (all threads stopped)");
Expand Down

0 comments on commit fbdc58e

Please sign in to comment.