Skip to content

Commit 615bc65

Browse files
committed
Repairs from nightly clippy
1 parent 5e76ab4 commit 615bc65

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

src/cmd/email/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub(super) fn command() -> clap::Command<'static> {
6161
.multiple_values(true)
6262
.value_parser(clap::value_parser!(patchrange::Specification))
6363
.conflicts_with("all")
64-
.required_unless_present_any(&["all"]),
64+
.required_unless_present_any(["all"]),
6565
)
6666
.arg(argset::branch_arg())
6767
.arg(

src/cmd/email/send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub(super) fn command() -> clap::Command<'static> {
6666
.multiple_values(true)
6767
.value_parser(clap::builder::NonEmptyStringValueParser::new())
6868
.conflicts_with_all(&["all", "dump-aliases"])
69-
.required_unless_present_any(&["all", "dump-aliases"]),
69+
.required_unless_present_any(["all", "dump-aliases"]),
7070
)
7171
.arg(argset::branch_arg())
7272
.arg(

src/cmd/import.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ fn import_url(stack: Stack, matches: &clap::ArgMatches) -> Result<()> {
287287

288288
#[cfg(feature = "import-compressed")]
289289
fn import_tgz_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Path) -> Result<()> {
290-
let source_file = std::fs::File::open(&source_path)?;
290+
let source_file = std::fs::File::open(source_path)?;
291291
let mut archive = tar::Archive::new(flate2::read::GzDecoder::new(source_file));
292292
let temp_dir = tempfile::tempdir()?;
293293
archive.unpack(temp_dir.path())?;
@@ -297,7 +297,7 @@ fn import_tgz_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Pat
297297

298298
#[cfg(feature = "import-compressed")]
299299
fn import_tbz2_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Path) -> Result<()> {
300-
let source_file = std::fs::File::open(&source_path)?;
300+
let source_file = std::fs::File::open(source_path)?;
301301
let mut archive = tar::Archive::new(bzip2::read::BzDecoder::new(source_file));
302302
let temp_dir = tempfile::tempdir()?;
303303
archive.unpack(temp_dir.path())?;
@@ -307,7 +307,7 @@ fn import_tbz2_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Pa
307307

308308
#[cfg(feature = "import-compressed")]
309309
fn import_tar_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Path) -> Result<()> {
310-
let source_file = std::fs::File::open(&source_path)?;
310+
let source_file = std::fs::File::open(source_path)?;
311311
let mut archive = tar::Archive::new(source_file);
312312
let temp_dir = tempfile::tempdir()?;
313313
archive.unpack(temp_dir.path())?;

src/cmd/rebase.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ fn interactive_pushback(
304304
let dummy_edit_command = clap::Command::new("dummy-edit");
305305
let dummy_edit_command = patchedit::add_args(dummy_edit_command, false, false);
306306
let edit_matches = dummy_edit_command
307-
.try_get_matches_from(&["dummy-edit", "--edit", "--diff"])
307+
.try_get_matches_from(["dummy-edit", "--edit", "--diff"])
308308
.expect("dummy command has valid arguments");
309309
match patchedit::EditBuilder::default()
310310
.original_patchname(Some(patchname))
@@ -369,14 +369,14 @@ fn interactive_pushback(
369369
let dummy_squash_command = patchedit::add_args(dummy_squash_command, true, false);
370370
let squash_matches = match instruction.action {
371371
Action::Squash => {
372-
dummy_squash_command.try_get_matches_from(&["dummy-squash", "--edit"])
372+
dummy_squash_command.try_get_matches_from(["dummy-squash", "--edit"])
373373
}
374374
Action::Fixup => {
375375
let commit = stack.get_patch_commit(target_patchname);
376376
let message = commit.message_raw().ok_or_else(|| {
377377
anyhow!("Fixup target patch `{target_patchname}` has non-UTF-8 message")
378378
})?;
379-
dummy_squash_command.try_get_matches_from(&[
379+
dummy_squash_command.try_get_matches_from([
380380
"dummy-squash",
381381
"--message",
382382
message,

src/commit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl<'a> CommitMessage<'a> {
234234
match self {
235235
Self::Str(s) => s.as_bytes(),
236236
Self::String(s) => s.as_bytes(),
237-
Self::Raw { bytes, encoding: _ } => *bytes,
237+
Self::Raw { bytes, encoding: _ } => bytes,
238238
}
239239
}
240240
}

src/patchedit/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ impl<'a, 'repo> EditBuilder<'a, 'repo> {
608608
new_tree.id(),
609609
<Option<Vec<OsString>>>::None,
610610
false,
611-
&["--full-index"],
611+
["--full-index"],
612612
)?
613613
} else {
614614
// This is a special case for `stg new` without the `--refresh` option.
@@ -732,7 +732,7 @@ impl<'a, 'repo> EditBuilder<'a, 'repo> {
732732
Err(e) => {
733733
let diff = Some(DiffBuffer(diff));
734734
let failed_description_path = ".stgit-failed.patch";
735-
let mut stream = BufWriter::new(File::create(&failed_description_path)?);
735+
let mut stream = BufWriter::new(File::create(failed_description_path)?);
736736
let failed_patch_description = EditablePatchDescription {
737737
patchname,
738738
author,

src/templates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub(crate) fn get_template(repo: &git2::Repository, name: &str) -> Result<Option
4040
// /etc/stgit/templates.
4141

4242
for template_path in &template_paths {
43-
if let Ok(template_bytes) = std::fs::read(&template_path) {
43+
if let Ok(template_bytes) = std::fs::read(template_path) {
4444
let template = std::str::from_utf8(&template_bytes).map_err(|_| {
4545
anyhow!(
4646
"Template file `{}` contains non-UTF-8 data",

0 commit comments

Comments
 (0)