Skip to content

Dependency Management #173

Dependency Management

Dependency Management #173

GitHub Actions / Clippy Output failed Jun 2, 2024 in 1s

Clippy Output

2 errors, 70 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 2
Warning 70
Note 0
Help 0

Versions

  • rustc 1.78.0 (9b00956e5 2024-04-29)
  • cargo 1.78.0 (54d8815d0 2024-03-26)
  • clippy 0.1.78 (9b00956 2024-04-29)

Annotations

Check warning on line 186 in src/package/management.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> src/package/management.rs:186:9
    |
186 |         fs::create_dir_all(&temporary_path);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
186 |         let _ = fs::create_dir_all(&temporary_path);
    |         +++++++

Check warning on line 185 in src/package/management.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> src/package/management.rs:185:9
    |
185 |         fs::remove_dir_all(&temporary_path);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
    |
185 |         let _ = fs::remove_dir_all(&temporary_path);
    |         +++++++

Check warning on line 60 in src/package/lock.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

call to `.clone()` on a reference in this situation does nothing

warning: call to `.clone()` on a reference in this situation does nothing
  --> src/package/lock.rs:60:42
   |
60 |             let temp = lfc_include_folder.clone().join(lock.0);
   |                                          ^^^^^^^^
   |
   = note: the type `std::path::Path` does not implement `Clone`, so calling `clone` on `&std::path::Path` copies the reference, which does not do anything and can be removed
   = note: `#[warn(noop_method_call)]` on by default
help: remove this redundant call
   |
60 -             let temp = lfc_include_folder.clone().join(lock.0);
60 +             let temp = lfc_include_folder.join(lock.0);
   |

Check warning on line 37 in src/backends/mod.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
  --> src/backends/mod.rs:37:17
   |
37 |                 app.properties.merge(&library_properties);
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this `Result` may be an `Err` variant, which should be handled
   = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
   |
37 |                 let _ = app.properties.merge(&library_properties);
   |                 +++++++

Check warning on line 442 in src/package/mod.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

use of `unwrap_or` to construct default value

warning: use of `unwrap_or` to construct default value
   --> src/package/mod.rs:442:18
    |
442 |                 .unwrap_or(Vec::new())
    |                  ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default

Check warning on line 292 in src/package/mod.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

question mark operator is useless here

warning: question mark operator is useless here
   --> src/package/mod.rs:292:5
    |
292 |     Ok(deserializer.deserialize_str(VersioningVisitor)?)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `deserializer.deserialize_str(VersioningVisitor)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark

Check warning on line 268 in src/package/mod.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

question mark operator is useless here

warning: question mark operator is useless here
   --> src/package/mod.rs:268:5
    |
268 |     Ok(serializer.serialize_str(&version.to_string())?)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `serializer.serialize_str(&version.to_string())`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
    = note: `#[warn(clippy::needless_question_mark)]` on by default

Check failure on line 188 in src/package/target_properties.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

written amount is not handled

error: written amount is not handled
   --> src/package/target_properties.rs:188:9
    |
188 |         fd.write(self.cmake_include.0.as_ref())?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `Write::write_all` instead, or handle partial writes
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount

Check warning on line 150 in src/package/target_properties.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

this `impl` can be derived

warning: this `impl` can be derived
   --> src/package/target_properties.rs:143:1
    |
143 | / impl Default for AppTargetProperties {
144 | |     fn default() -> Self {
145 | |         Self {
146 | |             cmake_include: AutoCmakeLoad::default(),
...   |
149 | |     }
150 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
    = help: remove the manual implementation...
help: ...and instead derive it
    |
97  + #[derive(Default)]
98  | pub struct AppTargetProperties {
    |

Check warning on line 141 in src/package/target_properties.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

this `impl` can be derived

warning: this `impl` can be derived
   --> src/package/target_properties.rs:135:1
    |
135 | / impl Default for LibraryTargetProperties {
136 | |     fn default() -> Self {
137 | |         Self {
138 | |             cmake_include: AutoCmakeLoad::default(),
139 | |         }
140 | |     }
141 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
    = help: remove the manual implementation...
help: ...and instead derive it
    |
64  + #[derive(Default)]
65  | pub struct LibraryTargetProperties {
    |

Check warning on line 112 in src/package/target_properties.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/package/target_properties.rs:112:49
    |
112 |                         std::fs::read_to_string(&absolute_path)
    |                                                 ^^^^^^^^^^^^^^ help: change this to: `absolute_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 115 in src/package/target_properties.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

use of `unwrap_or` to construct default value

warning: use of `unwrap_or` to construct default value
   --> src/package/target_properties.rs:115:22
    |
115 |                     .unwrap_or(String::new()),
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default

Check warning on line 76 in src/package/target_properties.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
  --> src/package/target_properties.rs:76:49
   |
76 |                         std::fs::read_to_string(&absolute_path)
   |                                                 ^^^^^^^^^^^^^^ help: change this to: `absolute_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 79 in src/package/target_properties.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

use of `unwrap_or` to construct default value

warning: use of `unwrap_or` to construct default value
  --> src/package/target_properties.rs:79:22
   |
79 |                     .unwrap_or(String::new()),
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
   = note: `#[warn(clippy::unwrap_or_default)]` on by default

Check warning on line 47 in src/package/target_properties.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

this `impl` can be derived

warning: this `impl` can be derived
  --> src/package/target_properties.rs:43:1
   |
43 | / impl Default for AutoCmakeLoad {
44 | |     fn default() -> Self {
45 | |         Self(String::default())
46 | |     }
47 | | }
   | |_^
   |
   = 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: remove the manual implementation...
help: ...and instead derive it
   |
41 + #[derive(Default)]
42 | pub struct AutoCmakeLoad(String);
   |

Check warning on line 10 in src/package/target_properties.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

writing `&String` instead of `&str` involves a new object where a slice will do

warning: writing `&String` instead of `&str` involves a new object where a slice will do
  --> src/package/target_properties.rs:10:35
   |
10 |     fn read_file(&mut self, path: &String) -> anyhow::Result<AutoCmakeLoad>;
   |                                   ^^^^^^^ help: change this to: `&str`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

Check warning on line 88 in src/package/tree.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
  --> src/package/tree.rs:88:9
   |
88 |         return aggregator;
   |         ^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
88 -         return aggregator;
88 +         aggregator
   |

Check warning on line 200 in src/package/management.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/package/management.rs:200:50
    |
200 |         let lingo_toml_text = fs::read_to_string(&temporary_path.clone().join("Lingo.toml"))?;
    |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `temporary_path.clone().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 179 in src/package/management.rs

See this annotation in the file changed.

@github-actions 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:179:20
    |
179 |         base_path: &PathBuf,
    |                    ^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
help: change this to
    |
179 ~         base_path: &Path,
180 |     ) -> anyhow::Result<DependencyTreeNode> {
181 |         // creating the directory where the library will be housed
182 ~         let library_path = base_path.to_path_buf(); //.join("libs");
    |

Check warning on line 177 in src/package/management.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

writing `&String` instead of `&str` involves a new object where a slice will do

warning: writing `&String` instead of `&str` involves a new object where a slice will do
   --> src/package/management.rs:177:15
    |
177 |         name: &String,
    |               ^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
help: change this to
    |
177 ~         name: &str,
178 |         package: PackageDetails,
  ...
230 |         Ok(DependencyTreeNode {
231 ~             name: name.to_owned(),
    |

Check warning on line 152 in src/package/management.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

using `print!()` with a format string that ends in a single newline

warning: using `print!()` with a format string that ends in a single newline
   --> src/package/management.rs:152:17
    |
152 |                 print!("{} pulling ...\n", package_name.green().bold());
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline
help: use `println!` instead
    |
152 -                 print!("{} pulling ...\n", package_name.green().bold());
152 +                 println!("{} pulling ...", package_name.green().bold());
    |

Check warning on line 142 in src/package/management.rs

See this annotation in the file changed.

@github-actions 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:142:20
    |
142 |         root_path: &PathBuf,
    |                    ^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
help: change this to
    |
142 ~         root_path: &Path,
143 |     ) -> anyhow::Result<Vec<DependencyTreeNode>> {
144 |         let mut sub_dependencies = vec![];
145 |         self.pulling_queue.append(&mut dependencies);
146 ~         let sub_dependency_path = root_path.to_path_buf().join("libraries");
    |

Check failure on line 126 in src/package/management.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

written amount is not handled

error: written amount is not handled
   --> src/package/management.rs:126:9
    |
126 |         lock_file.write(serialized_json.as_ref())?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `Write::write_all` instead, or handle partial writes
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount
    = note: `#[deny(clippy::unused_io_amount)]` on by default

Check warning on line 136 in src/package/management.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
   --> src/package/management.rs:136:9
    |
136 |         return Ok(manager);
    |         ^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
136 -         return Ok(manager);
136 +         Ok(manager)
    |

Check warning on line 82 in src/package/management.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

you should consider adding a `Default` implementation for `DependencyManager`

warning: you should consider adding a `Default` implementation for `DependencyManager`
  --> src/package/management.rs:77:5
   |
77 | /     pub fn new() -> DependencyManager {
78 | |         Self {
79 | |             pulling_queue: Default::default(),
80 | |             lock: DependencyLock::new(),
81 | |         }
82 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
   |
76 + impl Default for DependencyManager {
77 +     fn default() -> Self {
78 +         Self::new()
79 +     }
80 + }
   |