Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dasJ committed Nov 25, 2022
1 parent 63dc43c commit f04de36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
Expand Down
18 changes: 7 additions & 11 deletions src/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,14 @@ fn upgrade_v3_pin(name: &str, raw_pin: &mut Map<String, Value>) -> 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));
Expand Down

0 comments on commit f04de36

Please sign in to comment.