Merge pull request #6356 from lcheylus/clippy-openbsd

Disable clippy::assigning_clones on OpenBSD
This commit is contained in:
Daniel Hofstetter 2024-05-05 13:06:33 +02:00 committed by GitHub
commit c2d55b4f84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 3 deletions

View file

@ -1120,7 +1120,9 @@ fn parse_path_args(
}; };
if options.strip_trailing_slashes { if options.strip_trailing_slashes {
#[allow(clippy::assigning_clones)] // clippy::assigning_clones added with Rust 1.78
// Rust version = 1.76 on OpenBSD stable/7.5
#[cfg_attr(not(target_os = "openbsd"), allow(clippy::assigning_clones))]
for source in &mut paths { for source in &mut paths {
*source = source.components().as_path().to_owned(); *source = source.components().as_path().to_owned();
} }

View file

@ -220,7 +220,9 @@ mod tests {
} }
#[test] #[test]
#[allow(clippy::assigning_clones)] // clippy::assigning_clones added with Rust 1.78
// Rust version = 1.76 on OpenBSD stable/7.5
#[cfg_attr(not(target_os = "openbsd"), allow(clippy::assigning_clones))]
fn test_dev_name_match() { fn test_dev_name_match() {
let tmp = tempfile::TempDir::new().expect("Failed to create temp dir"); let tmp = tempfile::TempDir::new().expect("Failed to create temp dir");
let dev_name = std::fs::canonicalize(tmp.path()) let dev_name = std::fs::canonicalize(tmp.path())

View file

@ -45,7 +45,9 @@ impl WatcherRx {
Tested for notify::InotifyWatcher and for notify::PollWatcher. Tested for notify::InotifyWatcher and for notify::PollWatcher.
*/ */
if let Some(parent) = path.parent() { if let Some(parent) = path.parent() {
#[allow(clippy::assigning_clones)] // clippy::assigning_clones added with Rust 1.78
// Rust version = 1.76 on OpenBSD stable/7.5
#[cfg_attr(not(target_os = "openbsd"), allow(clippy::assigning_clones))]
if parent.is_dir() { if parent.is_dir() {
path = parent.to_owned(); path = parent.to_owned();
} else { } else {