From f04de36c09f9bca0d9f0eff8fba74af0f208380c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Fri, 25 Nov 2022 15:44:30 +0100 Subject: [PATCH] cargo fmt --- src/channel.rs | 3 ++- src/versions.rs | 18 +++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/channel.rs b/src/channel.rs index e1371b1..94c50f3 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -74,7 +74,8 @@ impl Updatable for Pin { * https://releases.nixos.org/nixos/21.11/nixos-21.11.335807.df4f1f7cc3f */ let hash = - nix::nix_prefetch_tarball(&version.url, Some(Self::calc_filename(&version.url)?)).await?; + nix::nix_prefetch_tarball(&version.url, Some(Self::calc_filename(&version.url)?)) + .await?; Ok(ChannelHash { hash }) } diff --git a/src/versions.rs b/src/versions.rs index 86567e9..4fbe722 100644 --- a/src/versions.rs +++ b/src/versions.rs @@ -259,18 +259,14 @@ fn upgrade_v3_pin(name: &str, raw_pin: &mut Map) -> Result<()> { OldPin::Channel { url } => { raw_pin.insert("filename".into(), json!(channel::Pin::calc_filename(&url)?)); }, - OldPin::GitRelease { repository, .. } | - OldPin::Git { repository, .. } => { + OldPin::GitRelease { repository, .. } | OldPin::Git { repository, .. } => { let filename = match repository { - Repository::GitLab { repo_path } => { - Some(format!("npins-gitlab-{}.tar.gz", repo_path.split('/').last().unwrap().to_owned())) - }, - Repository::GitHub { repo } => { - Some(format!("npins-github-{}.tar.gz", repo)) - }, - _ => { - None - } + Repository::GitLab { repo_path } => Some(format!( + "npins-gitlab-{}.tar.gz", + repo_path.split('/').last().unwrap().to_owned() + )), + Repository::GitHub { repo } => Some(format!("npins-github-{}.tar.gz", repo)), + _ => None, }; if let Some(filename) = filename { raw_pin.insert("filename".into(), json!(filename));