Skip to content

Commit

Permalink
rustfmt fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinaboos committed Jul 2, 2024
1 parent 596c5a4 commit 76f7e71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
21 changes: 10 additions & 11 deletions crates/packager/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,19 +227,19 @@ impl DebianConfig {
I: IntoIterator<Item = S>,
S: Into<String>,
{
self.depends
.replace(Dependencies::List(depends.into_iter().map(Into::into).collect()));
self.depends.replace(Dependencies::List(
depends.into_iter().map(Into::into).collect(),
));
self
}

/// Set the list of Debian dependencies indirectly via a path to a file,
/// which must contain one dependency (a package name) per line.
pub fn depends_path<P>(mut self, path: P) -> Self
where
P: Into<PathBuf>
P: Into<PathBuf>,
{
self.depends
.replace(Dependencies::Path(path.into()));
self.depends.replace(Dependencies::Path(path.into()));
self
}

Expand Down Expand Up @@ -299,7 +299,6 @@ impl DebianConfig {
}
}


/// A list of dependencies specified as either a list of Strings
/// or as a path to a file that lists the dependencies, one per line.
#[derive(Debug, Clone, Deserialize, Serialize)]
Expand Down Expand Up @@ -500,19 +499,19 @@ impl PacmanConfig {
I: IntoIterator<Item = S>,
S: Into<String>,
{
self.depends
.replace(Dependencies::List(depends.into_iter().map(Into::into).collect()));
self.depends.replace(Dependencies::List(
depends.into_iter().map(Into::into).collect(),
));
self
}

/// Set the list of pacman dependencies indirectly via a path to a file,
/// which must contain one dependency (a package name) per line.
pub fn depends_path<P>(mut self, path: P) -> Self
where
P: Into<PathBuf>
P: Into<PathBuf>,
{
self.depends
.replace(Dependencies::Path(path.into()));
self.depends.replace(Dependencies::Path(path.into()));
self
}

Expand Down
7 changes: 2 additions & 5 deletions crates/packager/src/package/deb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,12 @@ fn generate_control_file(
if let Some(homepage) = &config.homepage {
writeln!(file, "Homepage: {}", homepage)?;
}
if let Some(depends) = config
.deb()
.and_then(|d| d.depends.as_ref())
{
if let Some(depends) = config.deb().and_then(|d| d.depends.as_ref()) {
let dependencies = depends.to_list()?;
if !dependencies.is_empty() {
writeln!(file, "Depends: {}", dependencies.join(", "))?;
}
}
}

writeln!(
file,
Expand Down

0 comments on commit 76f7e71

Please sign in to comment.