Skip to content

Commit 26fe727

Browse files
committed
Fix clippy lints
1 parent 3ea6852 commit 26fe727

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

gui/src/clipboard.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn read_document_from_system(
4141
}
4242
};
4343
log_formats(&diagnostics);
44-
return result;
44+
result
4545
}
4646

4747
#[cfg(not(any(target_os = "macos", target_os = "windows", target_os = "linux")))]

gui/src/rtf.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub fn parse_rtf_document(bytes: &[u8]) -> Result<Document, RtfImportError> {
5555
);
5656

5757
if appended {
58-
last_paragraph_state = Some(block.paragraph.clone());
58+
last_paragraph_state = Some(block.paragraph);
5959
}
6060
}
6161

@@ -190,7 +190,7 @@ fn inject_paragraph_sentinels(input: &str) -> Cow<'_, str> {
190190
let mut last_copied = 0;
191191
let mut output: Option<String> = None;
192192

193-
while i + NEEDLE.len() + 1 <= bytes.len() {
193+
while i + NEEDLE.len() < bytes.len() {
194194
if bytes[i] != b'\\' {
195195
i += 1;
196196
continue;
@@ -208,13 +208,12 @@ fn inject_paragraph_sentinels(input: &str) -> Cow<'_, str> {
208208
continue;
209209
}
210210
let after_word = i + 1 + NEEDLE.len();
211-
if let Some(next) = bytes.get(after_word) {
212-
if next.is_ascii_alphabetic() {
211+
if let Some(next) = bytes.get(after_word)
212+
&& next.is_ascii_alphabetic() {
213213
// Skip \pard, \parshape, etc.
214214
i += 1;
215215
continue;
216216
}
217-
}
218217
let mut after_space = after_word;
219218
if bytes.get(after_space) == Some(&b' ') {
220219
after_space += 1;

0 commit comments

Comments
 (0)