Dependency Management #68
Clippy Output
16 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 16 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.81.0 (eeb90cda1 2024-09-04)
- cargo 1.81.0 (2dbb1af80 2024-08-20)
- clippy 0.1.81 (eeb90cd 2024-09-04)
Annotations
Check warning on line 283 in src/package/management.rs
github-actions / Clippy Output
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/package/management.rs:283:32
|
283 | value.push(&node);
| ^^^^^ help: change this to: `node`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 251 in src/package/management.rs
github-actions / Clippy Output
this lifetime isn't used in the function definition
warning: this lifetime isn't used in the function definition
--> src/package/management.rs:251:16
|
251 | fn flatten<'a>(root_nodes: Vec<DependencyTreeNode>) -> anyhow::Result<Vec<DependencyTreeNode>> {
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
= note: `#[warn(clippy::extra_unused_lifetimes)]` on by default
Check warning on line 197 in src/package/management.rs
github-actions / Clippy Output
the borrowed expression implements the required traits
warning: the borrowed expression implements the required traits
--> src/package/management.rs:197:28
|
197 | fs::create_dir_all(&library_path)?;
| ^^^^^^^^^^^^^ help: change this to: `library_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 87 in src/package/management.rs
github-actions / Clippy Output
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
--> src/package/management.rs:87:22
|
87 | target_path: &PathBuf,
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
help: change this to
|
87 ~ target_path: &Path,
88 | ) -> anyhow::Result<DependencyManager> {
89 | // create library folder
90 ~ let library_path = target_path.to_path_buf().join(LIBRARY_DIRECTORY);
91 | fs::create_dir_all(&library_path)?;
...
94 | let mut lock: DependencyLock;
95 ~ let lock_file = target_path.to_path_buf().join("../Lingo.lock");
96 |
...
104| // integrity of the build directory
105~ if let Ok(()) = lock.init(&target_path.to_path_buf().join("lfc_include")) {
106| return Ok(DependencyManager {
...
134| // moves the selected packages into the include folder
135~ let include_folder = target_path.to_path_buf().join("lfc_include");
|
Check warning on line 63 in src/package/management.rs
github-actions / Clippy Output
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/package/management.rs:63:65
|
63 | let (object, reference) = repo.revparse_ext(&name)?;
| ^^^^^ help: change this to: `name`
|
= 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 287 in src/package/lock.rs
github-actions / Clippy Output
unneeded `return` statement
warning: unneeded `return` statement
--> src/package/lock.rs:287:9
|
287 | return Ok(i);
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
287 - return Ok(i);
287 + Ok(i)
|
Check warning on line 267 in src/package/lock.rs
github-actions / Clippy Output
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
--> src/package/lock.rs:267:22
|
267 | source_path: &PathBuf,
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
help: change this to
|
267 ~ source_path: &Path,
268 | target_path: &PathBuf,
...
271 | for (_, dep) in self.dependencies.iter() {
272 ~ let local_source = source_path.to_path_buf().join(&dep.checksum);
|
Check warning on line 278 in src/package/lock.rs
github-actions / Clippy Output
unneeded `return` statement
warning: unneeded `return` statement
--> src/package/lock.rs:278:9
|
278 | return Ok(());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
278 - return Ok(());
278 + Ok(())
|
Check warning on line 229 in src/package/lock.rs
github-actions / Clippy Output
the borrowed expression implements the required traits
warning: the borrowed expression implements the required traits
--> src/package/lock.rs:229:54
|
229 | let lingo_toml_text = fs::read_to_string(&temp.join("Lingo.toml"))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `temp.join("Lingo.toml")`
|
= 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 54 in src/package/lock.rs
github-actions / Clippy Output
name `PATH` contains a capitalized acronym
warning: name `PATH` contains a capitalized acronym
--> src/package/lock.rs:54:5
|
54 | PATH,
| ^^^^ help: consider making the acronym lowercase, except the initial letter: `Path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
Check warning on line 53 in src/package/lock.rs
github-actions / Clippy Output
name `TARBALL` contains a capitalized acronym
warning: name `TARBALL` contains a capitalized acronym
--> src/package/lock.rs:53:5
|
53 | TARBALL,
| ^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Tarball`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
Check warning on line 52 in src/package/lock.rs
github-actions / Clippy Output
name `GIT` contains a capitalized acronym
warning: name `GIT` contains a capitalized acronym
--> src/package/lock.rs:52:5
|
52 | GIT,
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Git`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
Check warning on line 51 in src/package/lock.rs
github-actions / Clippy Output
name `REGISTRY` contains a capitalized acronym
warning: name `REGISTRY` contains a capitalized acronym
--> src/package/lock.rs:51:5
|
51 | REGISTRY,
| ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Registry`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
= note: `#[warn(clippy::upper_case_acronyms)]` on by default
Check warning on line 51 in src/backends/mod.rs
github-actions / Clippy Output
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> src/backends/mod.rs:26:5
|
26 | / match command {
27 | | CommandSpec::Build(_build) => {
28 | | let manager = match DependencyManager::from_dependencies(
29 | | dependencies.clone(),
... |
50 | | _ => {}
51 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
26 ~ if let CommandSpec::Build(_build) = command {
27 + let manager = match DependencyManager::from_dependencies(
28 + dependencies.clone(),
29 + &PathBuf::from(OUTPUT_DIRECTORY),
30 + ) {
31 + Ok(value) => value,
32 + Err(e) => {
33 + error!("failed to create dependency manager because of {e}");
34 + return result;
35 + }
36 + };
37 +
38 + // enriching the apps with the target properties from the libraries
39 + let library_properties = manager.get_target_properties().expect("lib properties");
40 +
41 + // merging app with library target properties
42 + for app in &mut config.apps {
43 + if let Err(e) = app.properties.merge(&library_properties) {
44 + error!("cannot merge properties from the libraries with the app. error: {e}");
45 + return result;
46 + }
47 + }
48 + }
|
Check warning on line 24 in src/backends/mod.rs
github-actions / Clippy Output
explicit call to `.into_iter()` in function argument accepting `IntoIterator`
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> src/backends/mod.rs:24:39
|
24 | let dependencies = Vec::from_iter(config.dependencies.clone().into_iter());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `config.dependencies.clone()`
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/iter/traits/collect.rs:152:21
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
Check warning on line 34 in src/backends/cmake_c.rs
github-actions / Clippy Output
deref on an immutable reference
warning: deref on an immutable reference
--> src/backends/cmake_c.rs:34:16
|
34 | content += &*include_statement;
| ^^^^^^^^^^^^^^^^^^^ help: if you would like to reborrow, try removing `&*`: `include_statement`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
= note: `#[warn(clippy::borrow_deref_ref)]` on by default