Skip to content

Commit e58d956

Browse files
authored
ci: improve testing & fix Clippy warnings (#85)
* Re-enable LeakSanitizer; Rust bug was fixed: * rust-lang/rust#111073 * Run Clippy with `--all-targets --all-features` * Remove useless `cargo check` (we do `cargo build` anyway) * Fix new Clippy warnings * Temporarily disable MSRV test job -- dependencies need MSRV bump first
1 parent f84035d commit e58d956

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ jobs:
2929
run: docker run --rm posixacl-nightly cargo test --color=always
3030
# Run sanitizer checks. Only allowed on Rust nightly. https://github.com/japaric/rust-san
3131
# Cannot run sanitizers from Dockerfile, CAP_PTRACE is disallowed :(
32-
# DISABLED TEMPORARILY due to https://github.com/rust-lang/rust/issues/111073
33-
#- name: LeakSanitizer
34-
# run: docker run --rm --env RUSTFLAGS="-Z sanitizer=leak" posixacl-nightly cargo test --color=always
32+
- name: LeakSanitizer
33+
run: docker run --rm --env RUSTFLAGS="-Z sanitizer=leak" posixacl-nightly cargo test --color=always
3534
- name: AddressSanitizer
3635
# --tests to omit doc tests, doesn't play nice with AddressSanitizer
3736
run: docker run --rm --env RUSTFLAGS="-Z sanitizer=address" posixacl-nightly cargo test --tests --color=always
@@ -49,14 +48,14 @@ jobs:
4948
--tag=posixacl-stable
5049
- name: Test suite
5150
run: docker run --rm posixacl-stable cargo test --color=always
52-
- name: cargo check
53-
run: docker run --rm posixacl-stable cargo check --color=always
5451
- name: Clippy lints
55-
run: docker run --rm posixacl-stable cargo clippy --color=always
52+
run: docker run --rm posixacl-stable cargo clippy --color=always --all-targets --all-features -- -D warnings
5653
- name: rustfmt
5754
run: docker run --rm posixacl-stable cargo fmt -- --color=always --check
5855

5956
rust-msrv:
57+
# FIXME disabled temporarily, needs MSRV bump
58+
if: false
6059
runs-on: ubuntu-latest
6160
steps:
6261
- uses: actions/checkout@v4

src/acl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl PosixACL {
146146
/// # Errors
147147
/// * `ACLError::IoError`: Filesystem errors (file not found, permission denied, etc).
148148
/// * `ACLError::ValidationError`: The ACL failed validation. See [`PosixACL::validate()`] for
149-
/// more information.
149+
/// more information.
150150
pub fn write_acl<P: AsRef<Path>>(&mut self, path: P) -> Result<(), ACLError> {
151151
self.write_acl_flags(path.as_ref(), ACL_TYPE_ACCESS)
152152
}
@@ -163,7 +163,7 @@ impl PosixACL {
163163
/// # Errors
164164
/// * `ACLError::IoError`: Filesystem errors (file not found, permission denied, etc).
165165
/// * `ACLError::ValidationError`: The ACL failed validation. See [`PosixACL::validate()`] for
166-
/// more information.
166+
/// more information.
167167
pub fn write_default_acl<P: AsRef<Path>>(&mut self, path: P) -> Result<(), ACLError> {
168168
self.write_acl_flags(path.as_ref(), ACL_TYPE_DEFAULT)
169169
}

src/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl<'a> RawACLIterator<'a> {
1818
}
1919
}
2020

21-
impl<'a> Iterator for RawACLIterator<'a> {
21+
impl Iterator for RawACLIterator<'_> {
2222
type Item = acl_entry_t;
2323

2424
fn next(&mut self) -> Option<Self::Item> {

tests/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ fn read_default_acl() {
262262
assert_eq!(format!("{:?}", acl), "PosixACL(\"\")");
263263
}
264264
/// Test different types accepted by AsRef<Path>
265+
#[allow(clippy::needless_borrows_for_generic_args)]
265266
#[test]
266267
fn path_types() {
267268
PosixACL::read_acl("/tmp").unwrap();

0 commit comments

Comments
 (0)