diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 301d6c88a2..ccf3642348 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -344,7 +344,7 @@ jobs: runs-on: macos-latest steps: - name: Set up Homebrew - uses: Homebrew/actions/setup-homebrew@master + uses: Homebrew/actions/setup-homebrew@main - name: Install stable Rust uses: actions-rs/toolchain@v1 diff --git a/asyncgit/src/sync/config.rs b/asyncgit/src/sync/config.rs index 8623b1aa16..2bedddf714 100644 --- a/asyncgit/src/sync/config.rs +++ b/asyncgit/src/sync/config.rs @@ -2,6 +2,7 @@ use crate::error::Result; use git2::Repository; use scopetime::scope_time; use serde::{Deserialize, Serialize}; +use std::str::FromStr; use super::{repository::repo, RepoPath}; @@ -73,11 +74,9 @@ pub enum PushDefaultStrategyConfig { Matching, } -impl<'a> TryFrom<&'a str> for PushDefaultStrategyConfig { - type Error = crate::Error; - fn try_from( - value: &'a str, - ) -> std::result::Result { +impl FromStr for PushDefaultStrategyConfig { + type Err = crate::Error; + fn from_str(value: &str) -> std::result::Result { match value { "nothing" => Ok(Self::Nothing), "current" => Ok(Self::Current), @@ -96,9 +95,7 @@ pub fn push_default_strategy_config_repo( ) -> Result { (get_config_string_repo(repo, "push.default")?).map_or_else( || Ok(PushDefaultStrategyConfig::default()), - |entry_str| { - PushDefaultStrategyConfig::try_from(entry_str.as_str()) - }, + |entry_str| entry_str.parse(), ) } diff --git a/src/queue.rs b/src/queue.rs index 5cdfe3cef0..5413841e19 100644 --- a/src/queue.rs +++ b/src/queue.rs @@ -21,11 +21,11 @@ use std::{ bitflags! { /// flags defining what part of the app need to update pub struct NeedsUpdate: u32 { - /// app::update + /// `app::update` const ALL = 0b001; - /// diff may have changed (app::update_diff) + /// diff may have changed (`app::update_diff`) const DIFF = 0b010; - /// commands might need updating (app::update_commands) + /// commands might need updating (`app::update_commands`) const COMMANDS = 0b100; /// branches have changed const BRANCHES = 0b1000;