This commit is contained in:
rusticorn
2026-10-05 19:10:19 +02:00
committed by extrawurst
parent 2fa693cb6e
commit 4fdda8ef6a
3 changed files with 9 additions and 12 deletions
+1 -1
View File
@@ -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
+5 -8
View File
@@ -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<Self, Self::Error> {
impl FromStr for PushDefaultStrategyConfig {
type Err = crate::Error;
fn from_str(value: &str) -> std::result::Result<Self, Self::Err> {
match value {
"nothing" => Ok(Self::Nothing),
"current" => Ok(Self::Current),
@@ -96,9 +95,7 @@ pub fn push_default_strategy_config_repo(
) -> Result<PushDefaultStrategyConfig> {
(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(),
)
}
+3 -3
View File
@@ -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;