Skip to content

Commit

Permalink
Style(Rustfmt): Run
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
  • Loading branch information
PaulDance committed Feb 18, 2024
1 parent 517f394 commit 970f7e4
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
7 changes: 4 additions & 3 deletions src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<String, Package>,
installed: &BTreeSet<String>,
Expand Down
3 changes: 2 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
3 changes: 2 additions & 1 deletion src/config/cargo_crates_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 8 additions & 4 deletions src/config/user_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self> {
let path = Self::file_path()?;
debug!("Reading configuration from {:#?}...", &path);
Expand Down Expand Up @@ -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<String> {
debug!("Serializing configuration...");
let res = toml::to_string_pretty(self)?;
Expand Down Expand Up @@ -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() {
Expand Down
8 changes: 3 additions & 5 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 970f7e4

Please sign in to comment.