Skip to content

Fix some warnings #2718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/cli/topical_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ fn search_path(doc: &DocData<'_>, wpath: &Path, keywords: &[&str]) -> Result<Pat
return Ok(dir.join(filename));
}
}
no_document(doc.topic)
} else {
no_document(doc.topic)
}
no_document(doc.topic)
}

pub fn local_path(root: &Path, topic: &str) -> Result<PathBuf> {
Expand Down
2 changes: 1 addition & 1 deletion src/diskio/immediate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ impl IncrementalFileWriter {
opts.write(true).create(true).truncate(true).open(path)?
});
Ok(IncrementalFileWriter {
file,
state,
file,
path_display,
})
}
Expand Down
6 changes: 3 additions & 3 deletions src/diskio/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn test_incremental_file(io_threads: &str) -> Result<()> {
vars,
..Default::default()
});
currentprocess::with(tp.clone(), || -> Result<()> {
currentprocess::with(tp, || -> Result<()> {
let mut written = 0;
let mut file_finished = false;
let mut io_executor: Box<dyn Executor> = get_executor(None)?;
Expand All @@ -31,7 +31,7 @@ fn test_incremental_file(io_threads: &str) -> Result<()> {
chunk.extend(b"0123456789");
// We should be able to submit more than one chunk
sender(chunk.clone());
sender(chunk.clone());
sender(chunk);
loop {
for work in io_executor.completed().collect::<Vec<_>>() {
match work {
Expand All @@ -54,7 +54,7 @@ fn test_incremental_file(io_threads: &str) -> Result<()> {
}
}
}
if file_finished == true {
if file_finished {
break;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#![allow(
clippy::too_many_arguments,
clippy::type_complexity,
clippy::upper_case_acronyms // see https://github.com/rust-lang/rust-clippy/issues/6974
clippy::upper_case_acronyms, // see https://github.com/rust-lang/rust-clippy/issues/6974
clippy::vec_init_then_push, // uses two different styles of initialization
)]
#![recursion_limit = "1024"]

Expand Down
3 changes: 2 additions & 1 deletion tests/cli-inst-interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ Rust is installed now. Great!

"
)),
format!("pattern not found in \"\"\"{}\"\"\"", out.stdout)
"pattern not found in \"\"\"{}\"\"\"",
out.stdout
);
if cfg!(unix) {
assert!(!config.homedir.join(".profile").exists());
Expand Down
5 changes: 2 additions & 3 deletions tests/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,17 +501,16 @@ enum Compressions {
GZOnly,
AddXZ,
AddZStd,
AddXZAndZStd,
}
use Compressions::*;

impl Compressions {
fn enable_xz(self) -> bool {
matches!(self, AddXZ | AddXZAndZStd)
matches!(self, AddXZ)
}

fn enable_zst(self) -> bool {
matches!(self, AddZStd | AddXZAndZStd)
matches!(self, AddZStd)
}
}

Expand Down