Dependency Management #159
Clippy Output
1 error, 56 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 1 |
Warning | 56 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.77.2 (25ef9e3d8 2024-04-09)
- cargo 1.77.2 (e52e36006 2024-03-26)
- clippy 0.1.77 (25ef9e3 2024-04-09)
Annotations
Check warning on line 350 in src/package/mod.rs
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:350:18
|
350 | .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
= note: `#[warn(clippy::unwrap_or_default)]` on by default
Check warning on line 178 in src/package/mod.rs
github-actions / Clippy Output
question mark operator is useless here
warning: question mark operator is useless here
--> src/package/mod.rs:178:5
|
178 | 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 158 in src/package/mod.rs
github-actions / Clippy Output
question mark operator is useless here
warning: question mark operator is useless here
--> src/package/mod.rs:158:5
|
158 | 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 warning on line 19 in src/package/lock.rs
github-actions / Clippy Output
you should consider adding a `Default` implementation for `DependencyLock`
warning: you should consider adding a `Default` implementation for `DependencyLock`
--> src/package/lock.rs:15:5
|
15 | / pub fn new() -> DependencyLock {
16 | | Self {
17 | | dependencies: HashMap::new()
18 | | }
19 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
14 + impl Default for DependencyLock {
15 + fn default() -> Self {
16 + Self::new()
17 + }
18 + }
|
Check warning on line 140 in src/package/tree.rs
github-actions / Clippy Output
unneeded `return` statement
warning: unneeded `return` statement
--> src/package/tree.rs:140:9
|
140 | return aggregator
| ^^^^^^^^^^^^^^^^^
|
= 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`
|
140 | aggregator
|
Check warning on line 83 in src/package/tree.rs
github-actions / Clippy Output
the borrowed expression implements the required traits
warning: the borrowed expression implements the required traits
--> src/package/tree.rs:83:50
|
83 | let lingo_toml_text = fs::read_to_string(&self_path.clone().join("Lingo.toml"))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self_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 65 in src/package/tree.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/tree.rs:65:89
|
65 | pub(crate) fn recursive_fetching(name: &String, package: PackageDetails, base_path: &PathBuf) -> anyhow::Result<DependencyTreeNode> {
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
help: change this to
|
65 ~ pub(crate) fn recursive_fetching(name: &String, package: PackageDetails, base_path: &Path) -> anyhow::Result<DependencyTreeNode> {
66 | // creating the directory where the library will be housed
67 ~ let library_path = base_path.to_path_buf().join(name);
|
Check warning on line 119 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:119:73
|
119 | pub fn pull(dependencies: Vec<(String, PackageDetails)>, root_path: &PathBuf) -> anyhow::Result<Vec<DependencyTreeNode>> {
| ^^^^^^^^
|
= 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
|
119 ~ pub fn pull(dependencies: Vec<(String, PackageDetails)>, root_path: &Path) -> anyhow::Result<Vec<DependencyTreeNode>> {
120 | let mut sub_dependencies = vec![];
121 | for (package_name, package_details) in dependencies {
122 ~ let sub_dependency_path = root_path.to_path_buf().join("library");
|
Check failure on line 107 in src/package/management.rs
github-actions / Clippy Output
written amount is not handled
error: written amount is not handled
--> src/package/management.rs:107:9
|
107 | 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 81 in src/package/management.rs
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:75:5
|
75 | / pub fn new() -> DependencyManager {
76 | | Self {
77 | | dependencies: Vec::new(),
78 | | tree: Vec::new(),
79 | | lock: DependencyLock::new(),
80 | | }
81 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
|
74 + impl Default for DependencyManager {
75 + fn default() -> Self {
76 + Self::new()
77 + }
78 + }
|
Check warning on line 37 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:32:5
|
32 | / match command {
33 | | CommandSpec::Build(build) => {
34 | | let manager = DependencyManager::from_dependencies(dependencies.clone(), &config.clone().library.unwrap().output_root);
35 | | },
36 | | _ => {}
37 | | }
| |_____^
|
= 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
|
32 ~ if let CommandSpec::Build(build) = command {
33 + let manager = DependencyManager::from_dependencies(dependencies.clone(), &config.clone().library.unwrap().output_root);
34 + }
|
Check warning on line 30 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:30:39
|
30 | 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/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/iter/traits/collect.rs:150: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 20 in src/util/errors.rs
github-actions / Clippy Output
variant `InvalidPackageVersion` is never constructed
warning: variant `InvalidPackageVersion` is never constructed
--> src/util/errors.rs:20:5
|
12 | pub enum LingoError {
| ---------- variant in this enum
...
20 | InvalidPackageVersion(String)
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: `LingoError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
Check warning on line 55 in src/package/tree.rs
github-actions / Clippy Output
associated function `new` is never used
warning: associated function `new` is never used
--> src/package/tree.rs:55:19
|
54 | impl DependencyTreeNode {
| ----------------------- associated function in this implementation
55 | pub(crate) fn new() -> DependencyTreeNode {
| ^^^
Check warning on line 21 in src/package/lock.rs
github-actions / Clippy Output
type `package::management::LocationDescription` is more private than the item `package::lock::DependencyLock::from`
warning: type `package::management::LocationDescription` is more private than the item `package::lock::DependencyLock::from`
--> src/package/lock.rs:21:5
|
21 | pub fn from(dependencies: HashMap<String, LocationDescription>) -> DependencyLock {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function `package::lock::DependencyLock::from` is reachable at visibility `pub`
|
note: but type `package::management::LocationDescription` is only usable at visibility `pub(crate)`
--> src/package/management.rs:22:1
|
22 | pub(crate) struct LocationDescription {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 142 in src/package/management.rs
github-actions / Clippy Output
type `package::management::LocationDescription` is more private than the item `package::management::DependencyManager::flatten`
warning: type `package::management::LocationDescription` is more private than the item `package::management::DependencyManager::flatten`
--> src/package/management.rs:142:5
|
142 | pub fn flatten(root_nodes: Vec<DependencyTreeNode>) -> anyhow::Result<HashMap<String, LocationDescription>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function `package::management::DependencyManager::flatten` is reachable at visibility `pub`
|
note: but type `package::management::LocationDescription` is only usable at visibility `pub(crate)`
--> src/package/management.rs:22:1
|
22 | pub(crate) struct LocationDescription {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default
Check warning on line 171 in src/package/mod.rs
github-actions / Clippy Output
unused variable: `e`
warning: unused variable: `e`
--> src/package/mod.rs:171:41
|
171 | Versioning::from_str(v).map_err(|e| {
| ^ unused variable
172 | E::custom("not a valid version {e}")
| ------------------------- you might have meant to use string interpolation in this string literal
|
help: string interpolation only works in `format!` invocations
|
172 | E::custom(format!("not a valid version {e}"))
| ++++++++ +
help: if this is intentional, prefix it with an underscore
|
171 | Versioning::from_str(v).map_err(|_e| {
| ~~
Check warning on line 119 in src/backends/mod.rs
github-actions / Clippy Output
unused variable: `dependencies`
warning: unused variable: `dependencies`
--> src/backends/mod.rs:119:35
|
119 | fn for_apps(apps: &[&'a App], dependencies: Vec<(String, PackageDetails)>) -> Self {
| ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_dependencies`
Check warning on line 34 in src/backends/mod.rs
github-actions / Clippy Output
unused variable: `manager`
warning: unused variable: `manager`
--> src/backends/mod.rs:34:17
|
34 | let manager = DependencyManager::from_dependencies(dependencies.clone(), &config.clone().library.unwrap().output_root);
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_manager`
Check warning on line 33 in src/backends/mod.rs
github-actions / Clippy Output
unused variable: `build`
warning: unused variable: `build`
--> src/backends/mod.rs:33:28
|
33 | CommandSpec::Build(build) => {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_build`
|
= note: `#[warn(unused_variables)]` on by default
Check warning on line 137 in src/args.rs
github-actions / Clippy Output
use of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::bare_action`: `#[arg(action)]` is now the default and is no longer needed`
warning: use of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::bare_action`: `#[arg(action)]` is now the default and is no longer needed`
--> src/args.rs:137:25
|
137 | #[clap(short, long, action)]
| ^^^^^^
Check warning on line 137 in src/args.rs
github-actions / Clippy Output
use of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
warning: use of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
--> src/args.rs:137:7
|
137 | #[clap(short, long, action)]
| ^^^^
Check warning on line 133 in src/args.rs
github-actions / Clippy Output
use of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::bare_action`: `#[arg(action)]` is now the default and is no longer needed`
warning: use of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::bare_action`: `#[arg(action)]` is now the default and is no longer needed`
--> src/args.rs:133:25
|
133 | #[clap(short, long, action)]
| ^^^^^^
Check warning on line 133 in src/args.rs
github-actions / Clippy Output
use of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
warning: use of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
--> src/args.rs:133:7
|
133 | #[clap(short, long, action)]
| ^^^^
Check warning on line 126 in src/args.rs
github-actions / Clippy Output
use of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[command(...)]`
warning: use of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[command(...)]`
--> src/args.rs:126:3
|
126 | #[clap(about = "Build system for the Lingua Franca coordination language", long_about = None)]
| ^^^^