Skip to content

Commit acf4661

Browse files
committed
fix nighty and raise msrv
1 parent e7bc408 commit acf4661

38 files changed

+68
-110
lines changed

.clippy.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
msrv = "1.65.0"
2-
cognitive-complexity-threshold = 18
1+
msrv = "1.70.0"
2+
cognitive-complexity-threshold = 18

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ jobs:
220220
- name: Install Rust
221221
uses: dtolnay/rust-toolchain@nightly
222222

223-
- name: cargo-udeps
224-
run: |
225-
# cargo install --locked cargo-udeps
226-
cargo install --git https://github.com/est31/cargo-udeps --locked
227-
cargo +nightly udeps --all-targets
223+
- name: build cargo-udeps
224+
run: cargo install --git https://github.com/est31/cargo-udeps --locked
225+
226+
- name: run cargo-udeps
227+
run: cargo +nightly udeps --all-targets
228228

229229
log-test:
230230
name: Changelog Test

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.24.3"
44
authors = ["extrawurst <[email protected]>"]
55
description = "blazing fast terminal-ui for git"
66
edition = "2021"
7-
rust-version = "1.65"
7+
rust-version = "1.70"
88
exclude = [".github/*", ".vscode/*", "assets/*"]
99
homepage = "https://github.com/extrawurst/gitui"
1010
repository = "https://github.com/extrawurst/gitui"

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ clippy-nightly:
8282

8383
check: fmt clippy test deny
8484

85+
check-nightly:
86+
cargo +nightly c
87+
cargo +nightly clippy --workspace --all-features
88+
cargo +nightly t
89+
8590
deny:
8691
cargo deny check
8792

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ All contain a single binary file
215215

216216
### Requirements
217217

218-
- Minimum supported `rust`/`cargo` version: `1.65`
218+
- Minimum supported `rust`/`cargo` version: `1.70`
219219
- See [Install Rust](https://www.rust-lang.org/tools/install)
220220

221221
- To build openssl dependency (see https://docs.rs/openssl/latest/openssl/)

asyncgit/src/revlog.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ impl AsyncLog {
201201
) -> Result<()> {
202202
let start_time = Instant::now();
203203

204-
let mut entries = Vec::with_capacity(LIMIT_COUNT);
204+
let mut entries = vec![CommitId::default(); LIMIT_COUNT];
205+
entries.resize(0, CommitId::default());
206+
205207
let r = repo(repo_path)?;
206208
let mut walker =
207209
LogWalker::new(&r, LIMIT_COUNT)?.filter(filter);

asyncgit/src/sync/blame.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,8 @@ pub fn blame_file(
6969
utils::get_head_repo(&repo)?
7070
};
7171

72-
let spec = format!(
73-
"{}:{}",
74-
commit_id.to_string(),
75-
fixup_windows_path(file_path)
76-
);
72+
let spec =
73+
format!("{}:{}", commit_id, fixup_windows_path(file_path));
7774

7875
let object = repo.revparse_single(&spec)?;
7976
let blob = repo.find_blob(object.id())?;

asyncgit/src/sync/commit_files.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,7 @@ pub(crate) fn get_commit_diff<'a>(
162162
Some(&mut opts),
163163
)?;
164164

165-
if stashes
166-
.map(|stashes| stashes.contains(&id))
167-
.unwrap_or_default()
168-
{
165+
if stashes.is_some_and(|stashes| stashes.contains(&id)) {
169166
if let Ok(untracked_commit) = commit.parent_id(2) {
170167
let untracked_diff = get_commit_diff(
171168
repo,

asyncgit/src/sync/commit_filter.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ impl LogFilterSearch {
115115
.new_file()
116116
.path()
117117
.and_then(|file| file.as_os_str().to_str())
118-
.map(|file| self.match_text(file))
119-
.unwrap_or_default()
118+
.is_some_and(|file| self.match_text(file))
120119
{
121120
return true;
122121
}
@@ -125,8 +124,7 @@ impl LogFilterSearch {
125124
.old_file()
126125
.path()
127126
.and_then(|file| file.as_os_str().to_str())
128-
.map(|file| self.match_text(file))
129-
.unwrap_or_default()
127+
.is_some_and(|file| self.match_text(file))
130128
})
131129
}
132130

@@ -194,8 +192,7 @@ pub fn filter_commit_by_search(
194192
.ok()
195193
})
196194
.flatten()
197-
.map(|diff| filter.match_diff(&diff))
198-
.unwrap_or_default();
195+
.is_some_and(|diff| filter.match_diff(&diff));
199196

200197
let authors_match = filter
201198
.options
@@ -205,13 +202,11 @@ pub fn filter_commit_by_search(
205202
let name_match = commit
206203
.author()
207204
.name()
208-
.map(|name| filter.match_text(name))
209-
.unwrap_or_default();
205+
.is_some_and(|name| filter.match_text(name));
210206
let mail_match = commit
211207
.author()
212208
.email()
213-
.map(|name| filter.match_text(name))
214-
.unwrap_or_default();
209+
.is_some_and(|name| filter.match_text(name));
215210

216211
name_match || mail_match
217212
})

asyncgit/src/sync/commits_info.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::fmt::Display;
2+
13
use super::RepoPath;
24
use crate::{error::Result, sync::repository::repo};
35
use git2::{Commit, Error, Oid};
@@ -46,9 +48,12 @@ impl CommitId {
4648
}
4749
}
4850

49-
impl ToString for CommitId {
50-
fn to_string(&self) -> String {
51-
self.0.to_string()
51+
impl Display for CommitId {
52+
fn fmt(
53+
&self,
54+
f: &mut std::fmt::Formatter<'_>,
55+
) -> std::fmt::Result {
56+
write!(f, "{}", self.0)
5257
}
5358
}
5459

0 commit comments

Comments
 (0)