Skip to content

Commit 4cdedeb

Browse files
authored
Merge pull request #2718 from jyn514/warnings
Fix some warnings
2 parents 5f3420e + 05371b4 commit 4cdedeb

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

src/cli/topical_doc.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ fn search_path(doc: &DocData<'_>, wpath: &Path, keywords: &[&str]) -> Result<Pat
4242
return Ok(dir.join(filename));
4343
}
4444
}
45-
no_document(doc.topic)
46-
} else {
47-
no_document(doc.topic)
4845
}
46+
no_document(doc.topic)
4947
}
5048

5149
pub fn local_path(root: &Path, topic: &str) -> Result<PathBuf> {

src/diskio/immediate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ impl IncrementalFileWriter {
154154
opts.write(true).create(true).truncate(true).open(path)?
155155
});
156156
Ok(IncrementalFileWriter {
157-
file,
158157
state,
158+
file,
159159
path_display,
160160
})
161161
}

src/diskio/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn test_incremental_file(io_threads: &str) -> Result<()> {
1414
vars,
1515
..Default::default()
1616
});
17-
currentprocess::with(tp.clone(), || -> Result<()> {
17+
currentprocess::with(tp, || -> Result<()> {
1818
let mut written = 0;
1919
let mut file_finished = false;
2020
let mut io_executor: Box<dyn Executor> = get_executor(None)?;
@@ -31,7 +31,7 @@ fn test_incremental_file(io_threads: &str) -> Result<()> {
3131
chunk.extend(b"0123456789");
3232
// We should be able to submit more than one chunk
3333
sender(chunk.clone());
34-
sender(chunk.clone());
34+
sender(chunk);
3535
loop {
3636
for work in io_executor.completed().collect::<Vec<_>>() {
3737
match work {
@@ -54,7 +54,7 @@ fn test_incremental_file(io_threads: &str) -> Result<()> {
5454
}
5555
}
5656
}
57-
if file_finished == true {
57+
if file_finished {
5858
break;
5959
}
6060
}

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
#![allow(
33
clippy::too_many_arguments,
44
clippy::type_complexity,
5-
clippy::upper_case_acronyms // see https://github.com/rust-lang/rust-clippy/issues/6974
5+
clippy::upper_case_acronyms, // see https://github.com/rust-lang/rust-clippy/issues/6974
6+
clippy::vec_init_then_push, // uses two different styles of initialization
67
)]
78
#![recursion_limit = "1024"]
89

tests/cli-inst-interactive.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ Rust is installed now. Great!
106106
107107
"
108108
)),
109-
format!("pattern not found in \"\"\"{}\"\"\"", out.stdout)
109+
"pattern not found in \"\"\"{}\"\"\"",
110+
out.stdout
110111
);
111112
if cfg!(unix) {
112113
assert!(!config.homedir.join(".profile").exists());

tests/dist.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,17 +501,16 @@ enum Compressions {
501501
GZOnly,
502502
AddXZ,
503503
AddZStd,
504-
AddXZAndZStd,
505504
}
506505
use Compressions::*;
507506

508507
impl Compressions {
509508
fn enable_xz(self) -> bool {
510-
matches!(self, AddXZ | AddXZAndZStd)
509+
matches!(self, AddXZ)
511510
}
512511

513512
fn enable_zst(self) -> bool {
514-
matches!(self, AddZStd | AddXZAndZStd)
513+
matches!(self, AddZStd)
515514
}
516515
}
517516

0 commit comments

Comments
 (0)