on master help sign in
Fix clippy warnings.
commit7c4fa18764ed6a6c30125ed6bfc9b025216e9668 authorNathan Vegdahl <cessen@cessen.com> dateMon 21 Jun 2021, 12:02 (5 years ago) parentd333556
2 files changed+11−8
helix-core/src/line_ending.rs+7−7 helix-term/src/commands.rs+4−1
helix-core/src/line_ending.rs+7−7
@@ -132,19 +132,19 @@ pub fn get_line_ending(line: &RopeSlice) -> Option<LineEnding> {
132132pub fn get_line_ending_of_str(line: &str) -> Option<LineEnding> {
133133 if line.ends_with("\u{000D}\u{000A}") {
134134 Some(LineEnding::Crlf)
135− } else if line.ends_with("\u{000A}") {
135+ } else if line.ends_with('\u{000A}') {
136136 Some(LineEnding::LF)
137− } else if line.ends_with("\u{000B}") {
137+ } else if line.ends_with('\u{000B}') {
138138 Some(LineEnding::VT)
139− } else if line.ends_with("\u{000C}") {
139+ } else if line.ends_with('\u{000C}') {
140140 Some(LineEnding::FF)
141− } else if line.ends_with("\u{000D}") {
141+ } else if line.ends_with('\u{000D}') {
142142 Some(LineEnding::CR)
143− } else if line.ends_with("\u{0085}") {
143+ } else if line.ends_with('\u{0085}') {
144144 Some(LineEnding::Nel)
145− } else if line.ends_with("\u{2028}") {
145+ } else if line.ends_with('\u{2028}') {
146146 Some(LineEnding::LS)
147− } else if line.ends_with("\u{2029}") {
147+ } else if line.ends_with('\u{2029}') {
148148 Some(LineEnding::PS)
149149 } else {
150150 None
helix-term/src/commands.rs+4−1
@@ -1304,7 +1304,10 @@ mod cmd {
13041304
13051305 fn yank_joined_to_clipboard(editor: &mut Editor, args: &[&str], _: PromptEvent) {
13061306 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());
13081311 yank_joined_to_clipboard_impl(editor, separator);
13091312 }
13101313