diff --git a/src/cargo.rs b/src/cargo.rs index 04ebd49..cf36697 100644 --- a/src/cargo.rs +++ b/src/cargo.rs @@ -16,8 +16,8 @@ use semver::Version; use crate::config::Package; -/// Installs a package, by running `cargo install` passing the `name`, `version` and requested -/// `features`. +/// Installs a package, by running `cargo install` passing the `name`, `version` +/// and requested `features`. /// /// The launched process' path is determined using the `$CARGO` environment /// variable as it is set by Cargo when it calls an external subcommand's @@ -82,7 +82,8 @@ fn install( Ok(()) } -/// Runs `cargo install` for all packages listed in the given user configuration. +/// Runs `cargo install` for all packages listed in the given user +/// configuration. pub fn install_all( packages: &BTreeMap, installed: &BTreeSet, diff --git a/src/cli.rs b/src/cli.rs index 4072b7c..3a09400 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -161,7 +161,8 @@ pub struct ShipArgs { /// It can also be used as a workaround in case a certain operation fails /// in your particular environment, for example: reading from `.crates.toml` /// under the `$CARGO_HOME` or `$CARGO_INSTALL_ROOT` directory or making - /// requests to the registry. These operations will thus be entirely skipped. + /// requests to the registry. These operations will thus be entirely + /// skipped. #[arg(short = 'c', long)] pub skip_check: bool, diff --git a/src/config/cargo_crates_toml.rs b/src/config/cargo_crates_toml.rs index 9a0c4d2..a028dac 100644 --- a/src/config/cargo_crates_toml.rs +++ b/src/config/cargo_crates_toml.rs @@ -238,9 +238,10 @@ fn ver_to_req(ver: &Version, op: Op) -> VersionReq { #[cfg(test)] mod tests { - use super::*; use std::iter; + use super::*; + impl PackageSource { fn crates_io() -> Self { Self { diff --git a/src/config/user_config.rs b/src/config/user_config.rs index 26c8769..6606771 100644 --- a/src/config/user_config.rs +++ b/src/config/user_config.rs @@ -30,7 +30,8 @@ impl UserConfig { /// Deserializes the user's configuration file and returns the result. /// /// It may fail on multiple occasions: if Cargo's home may not be found, if - /// the file does not exist, if it cannot be read from or if it is malformed. + /// the file does not exist, if it cannot be read from or if it is + /// malformed. pub fn parse_file() -> Result { let path = Self::file_path()?; debug!("Reading configuration from {:#?}...", &path); @@ -75,7 +76,8 @@ impl UserConfig { Ok(()) } - /// Converts the config to a pretty TOML string with literal strings disabled. + /// Converts the config to a pretty TOML string with literal strings + /// disabled. fn to_string_pretty(&self) -> Result { debug!("Serializing configuration..."); let res = toml::to_string_pretty(self)?; @@ -122,10 +124,12 @@ impl UserConfig { #[cfg(test)] mod tests { - use super::*; + use std::iter; + use indoc::indoc; use semver::VersionReq; - use std::iter; + + use super::*; #[test] fn test_deser_userconfig_empty_iserr() { diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 1c79938..dfe2b0a 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -8,12 +8,10 @@ use std::io::Write; use std::path::Path; use std::{env, io, iter}; -use cargo_test_support::registry::Package; -use cargo_test_support::{ - compare, - registry::{HttpServer, RegistryBuilder, Request, Response, TestRegistry}, - TestEnv, +use cargo_test_support::registry::{ + HttpServer, Package, RegistryBuilder, Request, Response, TestRegistry, }; +use cargo_test_support::{compare, TestEnv}; use semver::Version; use snapbox::cmd::Command;