Skip to content

Update Rust crate clap to v4.5.48

0ba1020
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Update Rust crate clap to v4.5.48 #792

Update Rust crate clap to v4.5.48
0ba1020
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded Sep 20, 2025 in 0s

clippy

19 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 19
Note 0
Help 0

Versions

  • rustc 1.90.0 (1159e78c4 2025-09-14)
  • cargo 1.90.0 (840b83a10 2025-07-30)
  • clippy 0.1.90 (1159e78c47 2025-09-14)

Annotations

Check warning on line 42 in src/util/pass.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this can be `std::io::Error::other(_)`

warning: this can be `std::io::Error::other(_)`
  --> src/util/pass.rs:42:5
   |
42 |     io::Error::new(io::ErrorKind::Other, msg)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error
help: use `std::io::Error::other`
   |
42 -     io::Error::new(io::ErrorKind::Other, msg)
42 +     io::Error::other(msg)
   |

Check warning on line 22 in src/util/pass.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression borrows a value the compiler would automatically borrow

warning: this expression borrows a value the compiler would automatically borrow
  --> src/util/pass.rs:22:8
   |
22 |     Ok((&line[len..]).trim().into())
   |        ^^^^^^^^^^^^^^ help: change this to: `line[len..]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 29 in src/util/digest.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
  --> src/util/digest.rs:29:20
   |
29 |     Ok(hex::encode(&sh.finalize()))
   |                    ^^^^^^^^^^^^^^ help: change this to: `sh.finalize()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 22 in src/util/digest.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this can be `std::io::Error::other(_)`

warning: this can be `std::io::Error::other(_)`
  --> src/util/digest.rs:22:34
   |
22 |             Err(_) => return Err(io::Error::new(io::ErrorKind::Other, "Could not read file")),
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error
   = note: `#[warn(clippy::io_other_error)]` on by default
help: use `std::io::Error::other`
   |
22 -             Err(_) => return Err(io::Error::new(io::ErrorKind::Other, "Could not read file")),
22 +             Err(_) => return Err(io::Error::other("Could not read file")),
   |

Check warning on line 197 in src/http/session.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/http/session.rs:197:43
    |
197 |         let cnt = std::fs::read_to_string(&path).context(ReadSessionFileSnafu { path })?;
    |                                           ^^^^^ help: change this to: `path`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 210 in src/config.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/config.rs:210:24
    |
210 |         std::fs::write(&file, &c).map_err(|e| ConfigError::CreateDefault {
    |                        ^^^^^ help: change this to: `file`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 342 in src/cli/opts.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/cli/opts.rs:342:46
    |
342 |                 let np = Self::read_name_val(&basic_file)?;
    |                                              ^^^^^^^^^^^ help: change this to: `basic_file`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 337 in src/cli/opts.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/cli/opts.rs:337:46
    |
337 |                 let np = Self::read_name_val(&header_file)?;
    |                                              ^^^^^^^^^^^^ help: change this to: `header_file`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

Check warning on line 52 in src/cli/cmd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
  --> src/cli/cmd.rs:52:13
   |
52 |     fn exec<'a>(&self, args: &'a Context) -> Result<(), Self::CmdError>;
   |             ^^                ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
   = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
   |
52 -     fn exec<'a>(&self, args: &'a Context) -> Result<(), Self::CmdError>;
52 +     fn exec(&self, args: &Context) -> Result<(), Self::CmdError>;
   |

Check warning on line 102 in src/cli/cmd/view.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `ctx.cfg.pdf_viewer.get(0)`

warning: accessing first element with `ctx.cfg.pdf_viewer.get(0)`
   --> src/cli/cmd/view.rs:102:25
    |
102 |             let tool = &ctx.cfg.pdf_viewer.get(0).ok_or(Error::NoPdfViewer)?;
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ctx.cfg.pdf_viewer.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
    = note: `#[warn(clippy::get_first)]` on by default

Check warning on line 286 in src/cli/cmd/export.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/cli/cmd/export.rs:286:62
    |
286 |     let rel_link_target = pathdiff::diff_paths(&link_target, &link_name_path).unwrap();
    |                                                              ^^^^^^^^^^^^^^^ help: change this to: `link_name_path`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 286 in src/cli/cmd/export.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/cli/cmd/export.rs:286:48
    |
286 |     let rel_link_target = pathdiff::diff_paths(&link_target, &link_name_path).unwrap();
    |                                                ^^^^^^^^^^^^ help: change this to: `link_target`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 279 in src/cli/cmd/export.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/cli/cmd/export.rs:279:33
    |
279 |         std::fs::create_dir_all(&link_name_path).context(CreateFileSnafu)?;
    |                                 ^^^^^^^^^^^^^^^ help: change this to: `link_name_path`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 230 in src/cli/cmd/export.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/cli/cmd/export.rs:230:33
    |
230 |         std::fs::create_dir_all(&item_dir).context(CreateFileSnafu)?;
    |                                 ^^^^^^^^^ help: change this to: `item_dir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 24 in src/cli/cmd/export.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `impl` can be derived

warning: this `impl` can be derived
  --> src/cli/cmd/export.rs:20:1
   |
20 | / impl Default for LinkNaming {
21 | |     fn default() -> Self {
22 | |         LinkNaming::Id
23 | |     }
24 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
   = note: `#[warn(clippy::derivable_impls)]` on by default
help: replace the manual implementation with a derive attribute and mark the default variant
   |
14 + #[derive(Default)]
15 ~ pub enum LinkNaming {
16 |     /// Name links to items after the items' id.
17 ~     #[default]
18 ~     Id,
   |

Check warning on line 142 in src/cli/cmd/download.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/cli/cmd/download.rs:142:53
    |
142 | ...                   std::fs::create_dir_all(&parent).context(CreateFileSnafu)?;
    |                                               ^^^^^^^ help: change this to: `parent`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
    = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default

Check warning on line 114 in src/cli/cmd/admin.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you are explicitly cloning with `.map()`

warning: you are explicitly cloning with `.map()`
   --> src/cli/cmd/admin.rs:110:18
    |
110 |       let secret = opts
    |  __________________^
111 | |         .admin_secret
112 | |         .as_ref()
113 | |         .or(ctx.cfg.admin_secret.as_ref())
114 | |         .map(String::clone);
    | |___________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
    = note: `#[warn(clippy::map_clone)]` on by default
help: consider calling the dedicated `cloned` method
    |
110 ~     let secret = opts
111 +         .admin_secret
112 +         .as_ref()
113 ~         .or(ctx.cfg.admin_secret.as_ref()).cloned();
    |

Check warning on line 988 in src/http.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

bound is defined in more than one place

warning: bound is defined in more than one place
   --> src/http.rs:988:20
    |
988 |     pub fn copy_to<W: ?Sized>(&mut self, w: &mut W) -> Result<u64, Error>
    |                    ^
989 |     where
990 |         W: Write,
    |         ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations
    = note: `#[warn(clippy::multiple_bound_locations)]` on by default

Check warning on line 414 in src/cli/cmd/upload.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

empty line after doc comment

warning: empty line after doc comment
   --> src/cli/cmd/upload.rs:413:1
    |
413 | / /// Helper types
414 | |
    | |_^
415 |   mod matching {
    |   ------------ the comment documents this module
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
    = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default
    = help: if the empty line is unintentional, remove it