on master help sign in
Fix clippy warnings.
7c4fa18Nathan Vegdahl
helix-core/src/line_ending.rs+7−7
@@ -132,19 +132,19 @@ pub fn get_line_ending(line: &RopeSlice) -> Option<LineEnding> {
132pub fn get_line_ending_of_str(line: &str) -> Option<LineEnding> {
132pub fn get_line_ending_of_str(line: &str) -> Option<LineEnding> {
133 if line.ends_with("\u{000D}\u{000A}") {
133 if line.ends_with("\u{000D}\u{000A}") {
134 Some(LineEnding::Crlf)
134 Some(LineEnding::Crlf)
135− } else if line.ends_with("\u{000A}") {
135+ } else if line.ends_with('\u{000A}') {
136 Some(LineEnding::LF)
136 Some(LineEnding::LF)
137− } else if line.ends_with("\u{000B}") {
137+ } else if line.ends_with('\u{000B}') {
138 Some(LineEnding::VT)
138 Some(LineEnding::VT)
139− } else if line.ends_with("\u{000C}") {
139+ } else if line.ends_with('\u{000C}') {
140 Some(LineEnding::FF)
140 Some(LineEnding::FF)
141− } else if line.ends_with("\u{000D}") {
141+ } else if line.ends_with('\u{000D}') {
142 Some(LineEnding::CR)
142 Some(LineEnding::CR)
143− } else if line.ends_with("\u{0085}") {
143+ } else if line.ends_with('\u{0085}') {
144 Some(LineEnding::Nel)
144 Some(LineEnding::Nel)
145− } else if line.ends_with("\u{2028}") {
145+ } else if line.ends_with('\u{2028}') {
146 Some(LineEnding::LS)
146 Some(LineEnding::LS)
147− } else if line.ends_with("\u{2029}") {
147+ } else if line.ends_with('\u{2029}') {
148 Some(LineEnding::PS)
148 Some(LineEnding::PS)
149 } else {
149 } else {
150 None
150 None
helix-term/src/commands.rs+4−1
@@ -1304,7 +1304,10 @@ mod cmd {
1304
1304
1305 fn yank_joined_to_clipboard(editor: &mut Editor, args: &[&str], _: PromptEvent) {
1305 fn yank_joined_to_clipboard(editor: &mut Editor, args: &[&str], _: PromptEvent) {
1306 let (_, doc) = current!(editor);
1306 let (_, doc) = current!(editor);
1307− let separator = args.first().copied().unwrap_or(doc.line_ending.as_str());
1307+ let separator = args
1308+ .first()
1309+ .copied()
1310+ .unwrap_or_else(|| doc.line_ending.as_str());
1308 yank_joined_to_clipboard_impl(editor, separator);
1311 yank_joined_to_clipboard_impl(editor, separator);
1309 }
1312 }
1310
1313