on master help sign in
Address new clippy lints
8a60299Blaž Hrastnik
helix-term/src/commands/typed.rs+3−2
@@ -1,3 +1,4 @@
1+use std::fmt::Write;
1use std::ops::Deref;
2use std::ops::Deref;
2
3
3use crate::job::Job;
4use crate::job::Job;
@@ -1103,7 +1104,7 @@ fn get_character_info(
1103 codepoint
1104 codepoint
1104 };
1105 };
1105
1106
1106− unicode.push_str(&format!("{codepoint:0>4x}"));
1107+ write!(unicode, "{codepoint:0>4x}").unwrap();
1107 }
1108 }
1108
1109
1109 unicode.push(')');
1110 unicode.push(')');
@@ -1144,7 +1145,7 @@ fn get_character_info(
1144 }
1145 }
1145
1146
1146 for byte in &bytes[current_byte..] {
1147 for byte in &bytes[current_byte..] {
1147− hex.push_str(&format!(" {byte:0>2x}"));
1148+ write!(hex, " {byte:0>2x}").unwrap();
1148 }
1149 }
1149
1150
1150 current_byte = bytes.len();
1151 current_byte = bytes.len();
helix-term/src/ui/document.rs+1−1
@@ -419,7 +419,7 @@ impl<'a> TextRenderer<'a> {
419 // TODO special rendering for other whitespaces?
419 // TODO special rendering for other whitespaces?
420 Grapheme::Other { ref g } if g == " " => &self.space,
420 Grapheme::Other { ref g } if g == " " => &self.space,
421 Grapheme::Other { ref g } if g == "\u{00A0}" => &self.nbsp,
421 Grapheme::Other { ref g } if g == "\u{00A0}" => &self.nbsp,
422− Grapheme::Other { ref g } => &*g,
422+ Grapheme::Other { ref g } => g,
423 Grapheme::Newline => &self.newline,
423 Grapheme::Newline => &self.newline,
424 };
424 };
425
425