Browse Source

chore: clean global lint attributes and remove `clippy::pedantic`

ariasuni 3 weeks ago
parent
commit
898bae3813
2 changed files with 3 additions and 23 deletions
  1. 2 4
      src/fs/feature/xattr.rs
  2. 1 19
      src/main.rs

+ 2 - 4
src/fs/feature/xattr.rs

@@ -475,8 +475,7 @@ mod extended_attrs {
     ) -> io::Result<()> {
         for attr_name in attr_names {
             if let Some(name) = attr_name.to_str() {
-                let attr_name =
-                    CString::new(name).map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
+                let attr_name = CString::new(name).map_err(io::Error::other)?;
                 let value = get_attribute(path, &attr_name, follow_symlinks, getter)?;
                 attrs.push(Attribute {
                     name: format!("{namespace}::{name}"),
@@ -491,8 +490,7 @@ mod extended_attrs {
     pub fn attributes(path: &Path, follow_symlinks: bool) -> io::Result<Vec<Attribute>> {
         use libc::EPERM;
 
-        let path = CString::new(path.as_os_str().as_bytes())
-            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
+        let path = CString::new(path.as_os_str().as_bytes()).map_err(io::Error::other)?;
         let attr_names_system = list_attributes(&path, follow_symlinks, os::list_system_xattr)
             .or_else(|err| {
                 // Reading of attributes in the system namespace is only supported for root

+ 1 - 19
src/main.rs

@@ -4,28 +4,10 @@
 // SPDX-FileCopyrightText: 2023-2024 Christina Sørensen, eza contributors
 // SPDX-FileCopyrightText: 2014 Benjamin Sago
 // SPDX-License-Identifier: MIT
-#![warn(deprecated_in_future)]
 #![warn(future_incompatible)]
-#![warn(nonstandard_style)]
-#![warn(rust_2018_compatibility)]
-#![warn(rust_2018_idioms)]
 #![warn(trivial_casts, trivial_numeric_casts)]
-#![warn(unused)]
-#![warn(clippy::all, clippy::pedantic)]
-#![allow(clippy::cast_precision_loss)]
-#![allow(clippy::cast_possible_truncation)]
-#![allow(clippy::cast_possible_wrap)]
-#![allow(clippy::cast_sign_loss)]
-#![allow(clippy::enum_glob_use)]
-#![allow(clippy::map_unwrap_or)]
-#![allow(clippy::match_same_arms)]
-#![allow(clippy::module_name_repetitions)]
+#![warn(clippy::all)]
 #![allow(clippy::non_ascii_literal)]
-#![allow(clippy::option_if_let_else)]
-#![allow(clippy::too_many_lines)]
-#![allow(clippy::unused_self)]
-#![allow(clippy::upper_case_acronyms)]
-#![allow(clippy::wildcard_imports)]
 
 use std::env;
 use std::ffi::{OsStr, OsString};