Skip to content

Commit 7f88934

Browse files
naseschwarzNaseschwarz
and
Naseschwarz
authored
Bump msrv to 1.81 (#2613)
Co-authored-by: Naseschwarz <[email protected]>
1 parent 489918e commit 7f88934

File tree

13 files changed

+76
-43
lines changed

13 files changed

+76
-43
lines changed

.clippy.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
msrv = "1.70.0"
1+
msrv = "1.81.0"
22
cognitive-complexity-threshold = 18

.github/workflows/ci.yml

+27-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: [ubuntu-latest, macos-latest, windows-latest]
20-
rust: [nightly, stable, '1.70']
20+
rust: [nightly, stable, '1.81']
2121
runs-on: ${{ matrix.os }}
2222
continue-on-error: ${{ matrix.rust == 'nightly' }}
2323

@@ -41,6 +41,9 @@ jobs:
4141
toolchain: ${{ matrix.rust }}
4242
components: clippy
4343

44+
- name: Override rust toolchain
45+
run: rustup override set ${{ matrix.rust }}
46+
4447
- name: Rustup Show
4548
run: rustup show
4649

@@ -89,7 +92,7 @@ jobs:
8992
strategy:
9093
fail-fast: false
9194
matrix:
92-
rust: [nightly, stable, '1.70']
95+
rust: [nightly, stable, '1.81']
9396
continue-on-error: ${{ matrix.rust == 'nightly' }}
9497
steps:
9598
- uses: actions/checkout@v4
@@ -112,6 +115,12 @@ jobs:
112115
- name: Manually install target
113116
run: rustup target add x86_64-unknown-linux-musl
114117

118+
- name: Override rust toolchain
119+
run: rustup override set ${{ matrix.rust }}
120+
121+
- name: Rustup Show
122+
run: rustup show
123+
115124
- name: Setup MUSL
116125
run: |
117126
sudo apt-get -qq install musl-tools
@@ -135,7 +144,7 @@ jobs:
135144
strategy:
136145
fail-fast: false
137146
matrix:
138-
rust: [nightly, stable, '1.70']
147+
rust: [nightly, stable, '1.81']
139148
continue-on-error: ${{ matrix.rust == 'nightly' }}
140149
steps:
141150
- uses: actions/checkout@v4
@@ -151,6 +160,10 @@ jobs:
151160
uses: dtolnay/rust-toolchain@master
152161
with:
153162
toolchain: ${{ matrix.rust }}
163+
164+
- name: Override rust toolchain
165+
run: rustup override set ${{ matrix.rust }}
166+
154167
- name: Setup ARM toolchain
155168
run: |
156169
rustup target add aarch64-unknown-linux-gnu
@@ -166,6 +179,9 @@ jobs:
166179
echo "$GITHUB_WORKSPACE/gcc-arm-8.2-2018.08-x86_64-aarch64-linux-gnu/bin" >> $GITHUB_PATH
167180
echo "$GITHUB_WORKSPACE/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf/bin" >> $GITHUB_PATH
168181
182+
- name: Rustup Show
183+
run: rustup show
184+
169185
- name: Build Debug
170186
run: |
171187
make build-linux-arm-debug
@@ -179,7 +195,7 @@ jobs:
179195
strategy:
180196
fail-fast: false
181197
matrix:
182-
rust: [nightly, stable, '1.70']
198+
rust: [nightly, stable, '1.81']
183199
continue-on-error: ${{ matrix.rust == 'nightly' }}
184200
steps:
185201
- uses: actions/checkout@v4
@@ -195,9 +211,16 @@ jobs:
195211
uses: dtolnay/rust-toolchain@master
196212
with:
197213
toolchain: ${{ matrix.rust }}
214+
215+
- name: Override rust toolchain
216+
run: rustup override set ${{ matrix.rust }}
217+
198218
- name: Setup target
199219
run: rustup target add x86_64-apple-darwin
200220

221+
- name: Rustup Show
222+
run: rustup show
223+
201224
- name: Build Debug
202225
run: |
203226
make build-apple-x86-debug

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
* add `use_selection_fg` to theme file to allow customizing selection foreground color [[@Upsylonbare](https://github.com/Upsylonbare)] ([#2515](https://github.com/gitui-org/gitui/pull/2515))
1717

1818
### Changed
19+
* increase MSRV from 1.70 to 1.81 [[@naseschwarz](https://github.com/naseschwarz)] ([#2094](https://github.com/gitui-org/gitui/issues/2094))
1920
* improve syntax highlighting file detection [[@acuteenvy](https://github.com/acuteenvy)] ([#2524](https://github.com/extrawurst/gitui/pull/2524))
2021
* Updated project links to point to `gitui-org` instead of `extrawurst` [[@vasleymus](https://github.com/vasleymus)] ([#2538](https://github.com/gitui-org/gitui/pull/2538))
2122
* After commit: jump back to unstaged area [[@tommady](https://github.com/tommady)] ([#2476](https://github.com/extrawurst/gitui/issues/2476))

Cargo.toml

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

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ see [NIGHTLIES.md](./NIGHTLIES.md)
220220

221221
### Requirements
222222

223-
- Minimum supported `rust`/`cargo` version: `1.70`
223+
- Minimum supported `rust`/`cargo` version: `1.81`
224224
- See [Install Rust](https://www.rust-lang.org/tools/install)
225225

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

asyncgit/src/sync/branch/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ mod tests_branches {
701701
&root.as_os_str().to_str().unwrap().into();
702702

703703
let upstream_merge_res =
704-
get_branch_upstream_merge(&repo_path, "master");
704+
get_branch_upstream_merge(repo_path, "master");
705705
assert!(
706706
upstream_merge_res.is_ok_and(|v| v.as_ref().is_none())
707707
);
@@ -721,12 +721,12 @@ mod tests_branches {
721721
config
722722
.set_str(
723723
&format!("branch.{branch_name}.merge"),
724-
&upstrem_merge,
724+
upstrem_merge,
725725
)
726726
.expect("fail set branch merge config");
727727

728728
let upstream_merge_res =
729-
get_branch_upstream_merge(&repo_path, &branch_name);
729+
get_branch_upstream_merge(repo_path, branch_name);
730730
assert!(upstream_merge_res
731731
.as_ref()
732732
.is_ok_and(|v| v.as_ref().is_some()));

asyncgit/src/sync/hooks.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,8 @@ mod tests {
230230
create_hook_in_path(&hooks_folder.join("commit-msg"), hook);
231231

232232
let mut msg = String::from("test");
233-
let res = hooks_commit_msg(
234-
&hooks_folder.to_path_buf().into(),
235-
&mut msg,
236-
)
237-
.unwrap();
233+
let res =
234+
hooks_commit_msg(&hooks_folder.into(), &mut msg).unwrap();
238235
assert_eq!(
239236
res,
240237
HookResult::NotOk(String::from("rejected\n"))

asyncgit/src/sync/remotes/push.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ mod tests {
290290

291291
// Attempt force push,
292292
// should work as it forces the push through
293-
assert!(!push_branch(
293+
assert!(push_branch(
294294
&tmp_other_repo_dir.path().to_str().unwrap().into(),
295295
"origin",
296296
"master",
@@ -299,7 +299,7 @@ mod tests {
299299
None,
300300
None,
301301
)
302-
.is_err());
302+
.is_ok());
303303
}
304304

305305
#[test]

asyncgit/src/sync/stash.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ mod tests {
144144
let repo_path: &RepoPath =
145145
&root.as_os_str().to_str().unwrap().into();
146146

147-
assert!(!stash_save(repo_path, None, true, false).is_ok());
147+
assert!(stash_save(repo_path, None, true, false).is_err());
148148

149149
assert!(get_stashes(repo_path).unwrap().is_empty());
150150
}

asyncgit/src/sync/utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ mod tests {
242242
let root = repo.path().parent().unwrap();
243243
let repo_path = root.as_os_str().to_str().unwrap();
244244

245-
assert!(!stage_add_file(&repo_path.into(), file_path).is_ok());
245+
assert!(stage_add_file(&repo_path.into(), file_path).is_err());
246246
}
247247

248248
#[test]
@@ -440,7 +440,7 @@ mod tests {
440440
let repo_path: &RepoPath =
441441
&root.as_os_str().to_str().unwrap().into();
442442

443-
assert!(!get_head(repo_path).is_ok());
443+
assert!(get_head(repo_path).is_err());
444444

445445
Ok(())
446446
}

git2-hooks/src/hookspath.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ mod test {
331331
fn test_hookspath_relative() {
332332
assert_eq!(
333333
HookPaths::expand_path(
334-
&Path::new("pre-commit"),
335-
&Path::new("example_git_root"),
334+
Path::new("pre-commit"),
335+
Path::new("example_git_root"),
336336
)
337337
.unwrap(),
338338
Path::new("example_git_root").join("pre-commit")
@@ -346,7 +346,7 @@ mod test {
346346
assert_eq!(
347347
HookPaths::expand_path(
348348
&absolute_hook,
349-
&Path::new("example_git_root"),
349+
Path::new("example_git_root"),
350350
)
351351
.unwrap(),
352352
absolute_hook

src/args.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn setup_logging(path_override: Option<PathBuf>) -> Result<()> {
139139
path
140140
};
141141

142-
println!("Logging enabled. Log written to: {path:?}");
142+
println!("Logging enabled. Log written to: {}", path.display());
143143

144144
WriteLogger::init(
145145
LevelFilter::Trace,

src/components/commitlist.rs

+31-19
Original file line numberDiff line numberDiff line change
@@ -488,24 +488,36 @@ impl CommitList {
488488
txt.push(splitter.clone());
489489
}
490490

491-
let style_hash = normal
492-
.then(|| theme.commit_hash(selected))
493-
.unwrap_or_else(|| theme.commit_unhighlighted());
494-
let style_time = normal
495-
.then(|| theme.commit_time(selected))
496-
.unwrap_or_else(|| theme.commit_unhighlighted());
497-
let style_author = normal
498-
.then(|| theme.commit_author(selected))
499-
.unwrap_or_else(|| theme.commit_unhighlighted());
500-
let style_tags = normal
501-
.then(|| theme.tags(selected))
502-
.unwrap_or_else(|| theme.commit_unhighlighted());
503-
let style_branches = normal
504-
.then(|| theme.branch(selected, true))
505-
.unwrap_or_else(|| theme.commit_unhighlighted());
506-
let style_msg = normal
507-
.then(|| theme.text(true, selected))
508-
.unwrap_or_else(|| theme.commit_unhighlighted());
491+
let style_hash = if normal {
492+
theme.commit_hash(selected)
493+
} else {
494+
theme.commit_unhighlighted()
495+
};
496+
let style_time = if normal {
497+
theme.commit_time(selected)
498+
} else {
499+
theme.commit_unhighlighted()
500+
};
501+
let style_author = if normal {
502+
theme.commit_author(selected)
503+
} else {
504+
theme.commit_unhighlighted()
505+
};
506+
let style_tags = if normal {
507+
theme.tags(selected)
508+
} else {
509+
theme.commit_unhighlighted()
510+
};
511+
let style_branches = if normal {
512+
theme.branch(selected, true)
513+
} else {
514+
theme.commit_unhighlighted()
515+
};
516+
let style_msg = if normal {
517+
theme.text(true, selected)
518+
} else {
519+
theme.commit_unhighlighted()
520+
};
509521

510522
// commit hash
511523
txt.push(Span::styled(Cow::from(&*e.hash_short), style_hash));
@@ -898,7 +910,7 @@ mod tests {
898910
impl Default for CommitList {
899911
fn default() -> Self {
900912
Self {
901-
title: String::from("").into_boxed_str(),
913+
title: String::new().into_boxed_str(),
902914
selection: 0,
903915
highlighted_selection: Option::None,
904916
highlights: Option::None,

0 commit comments

Comments
 (0)