diff --git a/flake.nix b/flake.nix index 170204b..b0ae979 100644 --- a/flake.nix +++ b/flake.nix @@ -42,7 +42,7 @@ rustNightly = (import fenix { inherit pkgs; }).fromToolchainFile { file = ./rust-toolchain.toml; - sha256 = "sha256-XPGNBesOSwZJCXgynlavqa5QdsTAnodTmbx6t6XUWsY="; + sha256 = "sha256-AJ6LX/Q/Er9kS15bn9iflkUwcgYqRQxiOIL2ToVAXaU="; }; craneLib = (crane.mkLib pkgs).overrideToolchain rustNightly; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index bb15e79..6a301a5 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2024-12-15" +channel = "1.85.0" components = ["clippy", "rustfmt", "rust-src"] targets = ["x86_64-unknown-linux-gnu"] profile = "minimal" diff --git a/src/git.rs b/src/git.rs index 37a7a98..7755073 100644 --- a/src/git.rs +++ b/src/git.rs @@ -57,24 +57,26 @@ pub fn freeze_repos(dir: &str) -> anyhow::Result<()> { let repository = shared_repo.to_thread_local(); let branch = get_current_branch(&repository); let remote = get_remote_for_branch(&repository, branch.as_deref()); - if let Some(branch) = branch - && let Some(remote) = remote - { - let remote_url = get_url(&repository, &remote); - let relative_path = entry - .path() - .strip_prefix(Path::new(dir))? - .to_str() - .unwrap() - .to_string(); - repos.insert( - relative_path, - PersistableRepo { - remote_url, - head: branch, - }, - ); - } + let Some(branch) = branch else { + continue; + }; + let Some(remote) = remote else { + continue; + }; + let remote_url = get_url(&repository, &remote); + let relative_path = entry + .path() + .strip_prefix(Path::new(dir))? + .to_str() + .unwrap() + .to_string(); + repos.insert( + relative_path, + PersistableRepo { + remote_url, + head: branch, + }, + ); } } } diff --git a/src/main.rs b/src/main.rs index 90c3737..62afce5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,3 @@ -#![feature(let_chains)] #![allow(clippy::missing_errors_doc, clippy::missing_panics_doc)] pub mod cli; pub mod git;