Skip to content

Commit

Permalink
Run rustfmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Oct 22, 2021
1 parent fa404d7 commit 34b6160
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
use std::fmt;

use camino::Utf8PathBuf;
use semver::VersionReq;
use serde::{Deserialize, Deserializer, Serialize};
#[cfg(feature = "builder")]
use derive_builder::Builder;
use semver::VersionReq;
use serde::{Deserialize, Deserializer, Serialize};

#[derive(Eq, PartialEq, Clone, Debug, Copy, Hash, Serialize, Deserialize)]
/// Dependencies can come in three kinds
Expand Down
4 changes: 2 additions & 2 deletions src/diagnostic.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! This module contains `Diagnostic` and the types/functions it uses for deserialization.
use serde::{Deserialize, Serialize};
use std::fmt;
#[cfg(feature = "builder")]
use derive_builder::Builder;
use serde::{Deserialize, Serialize};
use std::fmt;

/// The error code associated to this diagnostic.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
Expand Down
6 changes: 5 additions & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::CargoMetadata { stderr } => {
write!(f, "`cargo metadata` exited with an error: {}", stderr.trim_end())
write!(
f,
"`cargo metadata` exited with an error: {}",
stderr.trim_end()
)
}
Error::Io(err) => write!(f, "failed to start `cargo metadata`: {}", err),
Error::Utf8(err) => write!(f, "cannot convert the stdout of `cargo metadata`: {}", err),
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@
//! ```
use camino::Utf8PathBuf;
#[cfg(feature = "builder")]
use derive_builder::Builder;
use std::collections::HashMap;
use std::env;
use std::fmt;
use std::path::PathBuf;
use std::process::Command;
use std::str::from_utf8;
#[cfg(feature = "builder")]
use derive_builder::Builder;

pub use camino;
pub use semver::Version;
Expand Down
4 changes: 2 additions & 2 deletions src/messages.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use super::{Diagnostic, PackageId, Target};
use camino::Utf8PathBuf;
#[cfg(feature = "builder")]
use derive_builder::Builder;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::io::{self, BufRead, Lines, Read};
#[cfg(feature = "builder")]
use derive_builder::Builder;

/// Profile settings used to determine which compiler flags to use for a
/// target.
Expand Down
2 changes: 1 addition & 1 deletion tests/selftest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::path::PathBuf;
use semver::Version;

use cargo_metadata::{CargoOpt, Error, MetadataCommand};
use serde::{Deserialize};
use serde::Deserialize;

#[derive(Debug, PartialEq, Eq, Deserialize)]
struct TestPackageMetadata {
Expand Down

0 comments on commit 34b6160

Please sign in to comment.