瀏覽代碼

src: Fix deprecated calls to 'feature = "cargo-clippy"'

Get rid of the deprecated attribute and simplify the lint indications.

Link: https://blog.rust-lang.org/2024/02/28/Clippy-deprecating-feature-cargo-clippy.html
Signed-off-by: Quentin Monnet <qmo@qmon.net>
Quentin Monnet 8 月之前
父節點
當前提交
5d622130c2
共有 9 個文件被更改,包括 14 次插入18 次删除
  1. 0 1
      Cargo.toml
  2. 1 1
      examples/allowed_memory.rs
  3. 1 1
      examples/load_elf.rs
  4. 7 10
      src/lib.rs
  5. 1 1
      tests/assembler.rs
  6. 1 1
      tests/cranelift.rs
  7. 1 1
      tests/misc.rs
  8. 1 1
      tests/ubpf_jit_x86_64.rs
  9. 1 1
      tests/ubpf_vm.rs

+ 0 - 1
Cargo.toml

@@ -49,7 +49,6 @@ hex = "0.4.3"
 
 [features]
 default = ["std"]
-cargo-clippy = []
 std = ["dep:time", "dep:libc", "combine/std"]
 cranelift = [
     "dep:cranelift-codegen",

+ 1 - 1
examples/allowed_memory.rs

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2024 Akenes SA <wouter.dullaert@exoscale.ch>
 
-#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
+#![allow(clippy::unreadable_literal)]
 
 extern crate elf;
 use std::{iter::FromIterator, ptr::addr_of};

+ 1 - 1
examples/load_elf.rs

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2016 6WIND S.A. <quentin.monnet@6wind.com>
 
-#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
+#![allow(clippy::unreadable_literal)]
 
 extern crate elf;
 use std::path::PathBuf;

+ 7 - 10
src/lib.rs

@@ -15,16 +15,13 @@
 #![allow(unused_mut)]
 // Allows old-style clippy
 #![allow(renamed_and_removed_lints)]
-#![cfg_attr(
-    feature = "cargo-clippy",
-    allow(
-        redundant_field_names,
-        single_match,
-        cast_lossless,
-        doc_markdown,
-        match_same_arms,
-        unreadable_literal
-    )
+#![allow(
+    clippy::redundant_field_names,
+    clippy::single_match,
+    clippy::cast_lossless,
+    clippy::doc_markdown,
+    clippy::match_same_arms,
+    clippy::unreadable_literal
 )]
 // Configures the crate to be `no_std` when `std` feature is disabled.
 #![cfg_attr(not(feature = "std"), no_std)]

+ 1 - 1
tests/assembler.rs

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
 // Copyright 2017 Rich Lane <lanerl@gmail.com>
 
-#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
+#![allow(clippy::unreadable_literal)]
 
 extern crate rbpf;
 mod common;

+ 1 - 1
tests/cranelift.rs

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
 
-#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
+#![allow(clippy::unreadable_literal)]
 #![cfg(feature = "cranelift")]
 
 extern crate rbpf;

+ 1 - 1
tests/misc.rs

@@ -3,7 +3,7 @@
 
 // There are unused mut warnings due to unsafe code.
 #![allow(unused_mut)]
-#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
+#![allow(clippy::unreadable_literal)]
 
 // This crate would be needed to load bytecode from a BPF-compiled object file. Since the crate
 // is not used anywhere else in the library, it is deactivated: we do not want to load and compile

+ 1 - 1
tests/ubpf_jit_x86_64.rs

@@ -16,7 +16,7 @@
 
 // These are unit tests for the eBPF JIT compiler.
 
-#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
+#![allow(clippy::unreadable_literal)]
 #![cfg(all(not(windows), feature = "std"))]
 
 extern crate rbpf;

+ 1 - 1
tests/ubpf_vm.rs

@@ -16,7 +16,7 @@
 
 // These are unit tests for the eBPF interpreter.
 
-#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
+#![allow(clippy::unreadable_literal)]
 
 extern crate rbpf;
 mod common;