Skip to content

Commit

Permalink
Bump the MSRV to Rust 1.64
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Jun 17, 2024
1 parent e7d23c9 commit 2ff8cca
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- nightly
- stable
# MSRV
- 1.56.1
- "1.64"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand Down
3 changes: 3 additions & 0 deletions .rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.64"
components = [ "rustfmt", "clippy" ]
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resolver = "2"

[workspace.package]
edition = "2021"
rust-version = "1.56"
rust-version = "1.64"
license = "MIT"
readme = "README.md"
version = "0.7.3"
Expand Down
37 changes: 37 additions & 0 deletions include_dir/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,40 @@ fn validate_extracted(dir: &Dir, path: &Path) {
assert!(file_path.exists());
}
}

#[test]
fn msrv_is_in_sync() {
let msrv = (include_str!("../../Cargo.toml"))
.lines()
.filter_map(|line| line.split_once(" = "))
.find_map(|(key, value)| {
if key.trim() == "rust-version" {
Some(value.trim().trim_matches('"'))
} else {
None
}
})
.unwrap();

let toolchain_version = (include_str!("../../.rust-toolchain.toml"))
.lines()
.filter_map(|line| line.split_once(" = "))
.find_map(|(key, value)| {
if key.trim() == "channel" {
Some(value.trim().trim_matches('"'))
} else {
None
}
})
.unwrap();
assert_eq!(toolchain_version, msrv);

let workflow_msrv = (include_str!("../../.github/workflows/main.yml"))
.lines()
.skip_while(|line| line.trim() != "# MSRV")
.skip(1)
.map(|line| line.trim().trim_start_matches('-').trim().trim_matches('"'))
.next()
.unwrap();
assert_eq!(workflow_msrv, msrv);
}

0 comments on commit 2ff8cca

Please sign in to comment.