Fix clippy warnings.
This commit is contained in:
parent
d33355650f
commit
7c4fa18764
2 changed files with 11 additions and 8 deletions
|
@ -132,19 +132,19 @@ pub fn get_line_ending(line: &RopeSlice) -> Option<LineEnding> {
|
||||||
pub fn get_line_ending_of_str(line: &str) -> Option<LineEnding> {
|
pub fn get_line_ending_of_str(line: &str) -> Option<LineEnding> {
|
||||||
if line.ends_with("\u{000D}\u{000A}") {
|
if line.ends_with("\u{000D}\u{000A}") {
|
||||||
Some(LineEnding::Crlf)
|
Some(LineEnding::Crlf)
|
||||||
} else if line.ends_with("\u{000A}") {
|
} else if line.ends_with('\u{000A}') {
|
||||||
Some(LineEnding::LF)
|
Some(LineEnding::LF)
|
||||||
} else if line.ends_with("\u{000B}") {
|
} else if line.ends_with('\u{000B}') {
|
||||||
Some(LineEnding::VT)
|
Some(LineEnding::VT)
|
||||||
} else if line.ends_with("\u{000C}") {
|
} else if line.ends_with('\u{000C}') {
|
||||||
Some(LineEnding::FF)
|
Some(LineEnding::FF)
|
||||||
} else if line.ends_with("\u{000D}") {
|
} else if line.ends_with('\u{000D}') {
|
||||||
Some(LineEnding::CR)
|
Some(LineEnding::CR)
|
||||||
} else if line.ends_with("\u{0085}") {
|
} else if line.ends_with('\u{0085}') {
|
||||||
Some(LineEnding::Nel)
|
Some(LineEnding::Nel)
|
||||||
} else if line.ends_with("\u{2028}") {
|
} else if line.ends_with('\u{2028}') {
|
||||||
Some(LineEnding::LS)
|
Some(LineEnding::LS)
|
||||||
} else if line.ends_with("\u{2029}") {
|
} else if line.ends_with('\u{2029}') {
|
||||||
Some(LineEnding::PS)
|
Some(LineEnding::PS)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
|
@ -1304,7 +1304,10 @@ mod cmd {
|
||||||
|
|
||||||
fn yank_joined_to_clipboard(editor: &mut Editor, args: &[&str], _: PromptEvent) {
|
fn yank_joined_to_clipboard(editor: &mut Editor, args: &[&str], _: PromptEvent) {
|
||||||
let (_, doc) = current!(editor);
|
let (_, doc) = current!(editor);
|
||||||
let separator = args.first().copied().unwrap_or(doc.line_ending.as_str());
|
let separator = args
|
||||||
|
.first()
|
||||||
|
.copied()
|
||||||
|
.unwrap_or_else(|| doc.line_ending.as_str());
|
||||||
yank_joined_to_clipboard_impl(editor, separator);
|
yank_joined_to_clipboard_impl(editor, separator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue