Skip to content

Commit d5dd4ca

Browse files
authored
Merge branch 'master' into add-ai-commit-message-helper
2 parents 4bb2369 + f5893d9 commit d5dd4ca

File tree

12 files changed

+28
-45
lines changed

12 files changed

+28
-45
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@ updates:
66
interval: daily
77
open-pull-requests-limit: 10
88
groups:
9-
cargo:
9+
cargo-minor:
1010
patterns: ["*"]
11+
update-types:
12+
- 'minor'
13+
cargo-patch:
14+
patterns: ["*"]
15+
update-types:
16+
- 'patch'

asyncgit/src/sync/config.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,18 @@ use super::{repository::repo, RepoPath};
88
// see https://git-scm.com/docs/git-config#Documentation/git-config.txt-statusshowUntrackedFiles
99
/// represents the `status.showUntrackedFiles` git config state
1010
#[derive(
11-
Hash, Copy, Clone, PartialEq, Eq, Serialize, Deserialize,
11+
Hash, Copy, Clone, Default, PartialEq, Eq, Serialize, Deserialize,
1212
)]
1313
pub enum ShowUntrackedFilesConfig {
1414
///
15+
#[default]
1516
No,
1617
///
1718
Normal,
1819
///
1920
All,
2021
}
2122

22-
impl Default for ShowUntrackedFilesConfig {
23-
fn default() -> Self {
24-
Self::No
25-
}
26-
}
27-
2823
impl ShowUntrackedFilesConfig {
2924
///
3025
pub const fn include_none(self) -> bool {
@@ -68,21 +63,16 @@ pub fn untracked_files_config_repo(
6863

6964
// see https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault
7065
/// represents `push.default` git config
71-
#[derive(PartialEq, Eq)]
66+
#[derive(PartialEq, Default, Eq)]
7267
pub enum PushDefaultStrategyConfig {
7368
Nothing,
7469
Current,
7570
Upstream,
71+
#[default]
7672
Simple,
7773
Matching,
7874
}
7975

80-
impl Default for PushDefaultStrategyConfig {
81-
fn default() -> Self {
82-
Self::Simple
83-
}
84-
}
85-
8676
impl<'a> TryFrom<&'a str> for PushDefaultStrategyConfig {
8777
type Error = crate::Error;
8878
fn try_from(

asyncgit/src/sync/diff.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ use serde::{Deserialize, Serialize};
2222
use std::{cell::RefCell, fs, path::Path, rc::Rc};
2323

2424
/// type of diff of a single line
25-
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
25+
#[derive(Copy, Clone, Default, PartialEq, Eq, Hash, Debug)]
2626
pub enum DiffLineType {
2727
/// just surrounding line, no change
28+
#[default]
2829
None,
2930
/// header of the hunk
3031
Header,
@@ -47,12 +48,6 @@ impl From<git2::DiffLineType> for DiffLineType {
4748
}
4849
}
4950

50-
impl Default for DiffLineType {
51-
fn default() -> Self {
52-
Self::None
53-
}
54-
}
55-
5651
///
5752
#[derive(Default, Clone, Hash, Debug)]
5853
pub struct DiffLine {

asyncgit/src/sync/remotes/push.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,15 @@ impl AsyncProgress for ProgressNotification {
9898
}
9999

100100
///
101-
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
101+
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
102102
pub enum PushType {
103103
///
104+
#[default]
104105
Branch,
105106
///
106107
Tag,
107108
}
108109

109-
impl Default for PushType {
110-
fn default() -> Self {
111-
Self::Branch
112-
}
113-
}
114-
115110
#[cfg(test)]
116111
pub fn push_branch(
117112
repo_path: &RepoPath,

asyncgit/src/sync/status.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,17 @@ pub struct StatusItem {
104104
}
105105

106106
///
107-
#[derive(Copy, Clone, Hash, PartialEq, Eq, Debug)]
107+
#[derive(Copy, Clone, Default, Hash, PartialEq, Eq, Debug)]
108108
pub enum StatusType {
109109
///
110+
#[default]
110111
WorkingDir,
111112
///
112113
Stage,
113114
///
114115
Both,
115116
}
116117

117-
impl Default for StatusType {
118-
fn default() -> Self {
119-
Self::WorkingDir
120-
}
121-
}
122-
123118
impl From<StatusType> for StatusShow {
124119
fn from(s: StatusType) -> Self {
125120
match s {

git2-hooks/src/hookspath.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ impl HookPaths {
146146
S: AsRef<OsStr>,
147147
{
148148
let hook = self.hook.clone();
149-
log::trace!("run hook '{:?}' in '{:?}'", hook, self.pwd);
149+
log::trace!(
150+
"run hook '{}' in '{}'",
151+
hook.display(),
152+
self.pwd.display()
153+
);
150154

151155
let run_command = |command: &mut Command| {
152156
command
@@ -250,7 +254,7 @@ fn is_executable(path: &Path) -> bool {
250254
let metadata = match path.metadata() {
251255
Ok(metadata) => metadata,
252256
Err(e) => {
253-
log::error!("metadata error: {}", e);
257+
log::error!("metadata error: {e}");
254258
return false;
255259
}
256260
};

src/cmdbar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl CommandBar {
104104
line_width += entry_w + 1;
105105

106106
self.draw_list.push(DrawListEntry::Command(Command {
107-
txt: c.text.name.to_string(),
107+
txt: c.text.name.clone(),
108108
enabled: c.enabled,
109109
line: lines.saturating_sub(1) as usize,
110110
}));

src/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@
4444
clippy::unwrap_used,
4545
clippy::filetype_is_file,
4646
clippy::cargo,
47-
clippy::unwrap_used,
4847
clippy::panic,
4948
clippy::match_like_matches_macro
5049
)]
51-
#![allow(clippy::module_name_repetitions)]
5250
#![allow(
5351
clippy::multiple_crate_versions,
5452
clippy::bool_to_int_with_if,

src/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl Options {
133133

134134
index = entries.saturating_sub(1) - index;
135135

136-
Some(self.data.commit_msgs[index].to_string())
136+
Some(self.data.commit_msgs[index].clone())
137137
}
138138
}
139139

src/popups/branchlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ impl BranchListPopup {
557557
theme.commit_hash(selected),
558558
);
559559
let span_msg = Span::styled(
560-
commit_message.to_string(),
560+
commit_message.clone(),
561561
theme.text(true, selected),
562562
);
563563
let span_name = Span::styled(

0 commit comments

Comments
 (0)