diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7dd6147..eaf04b8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -75,6 +75,9 @@ jobs:
- name: "Run Analyzer"
run: cargo check ${CI_CARGO_ARGS}
+ - name: "Run Clippy"
+ run: cargo clippy ${CI_CARGO_ARGS}
+
#
# A complete but basic build of the project, running on common x86-64 ubuntu
# machines. This should catch most compilation errors or test-suite failures
diff --git a/Cargo.toml b/Cargo.toml
index 344c95e..1ee5630 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -30,6 +30,18 @@ osi = { path = "./lib/osi", version = "1.0.0" }
sys = { path = "./lib/sys", version = "1.0.0" }
tmp = { path = "./lib/tmp", version = "1.0.0" }
+[workspace.lints.clippy]
+assertions_on_constants = "allow"
+explicit_auto_deref = "allow"
+identity_op = "allow"
+inherent_to_string_shadow_display = "allow"
+len_zero = "allow"
+manual_range_contains = "allow"
+needless_late_init = "allow"
+new_without_default = "allow"
+should_implement_trait = "allow"
+redundant_field_names = "allow"
+
[workspace.lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
diff --git a/lib/osi/src/lib.rs b/lib/osi/src/lib.rs
index c3a9eca..a7c547c 100644
--- a/lib/osi/src/lib.rs
+++ b/lib/osi/src/lib.rs
@@ -35,12 +35,6 @@
// that these can be greatly optimized by the compiler, they seem a worthy
// fit for the standard library.
-#![allow(clippy::assertions_on_constants)]
-#![allow(clippy::identity_op)]
-#![allow(clippy::manual_range_contains)]
-#![allow(clippy::should_implement_trait)]
-#![allow(clippy::redundant_field_names)]
-
#![no_std]
extern crate alloc;
diff --git a/lib/tmp/src/fmt/dbus/dvar.rs b/lib/tmp/src/fmt/dbus/dvar.rs
index a7df98c..b6d635f 100644
--- a/lib/tmp/src/fmt/dbus/dvar.rs
+++ b/lib/tmp/src/fmt/dbus/dvar.rs
@@ -76,31 +76,31 @@ impl Format {
}
}
- fn u8(&self, v: u8) -> [u8; 1] {
+ fn en_u8(&self, v: u8) -> [u8; 1] {
[v]
}
- fn u16(&self, v: u16) -> [u8; 2] {
+ fn en_u16(&self, v: u16) -> [u8; 2] {
if self.is_be() { v.to_be_bytes() } else { v.to_le_bytes() }
}
- fn u32(&self, v: u32) -> [u8; 4] {
+ fn en_u32(&self, v: u32) -> [u8; 4] {
if self.is_be() { v.to_be_bytes() } else { v.to_le_bytes() }
}
- fn u64(&self, v: u64) -> [u8; 8] {
+ fn en_u64(&self, v: u64) -> [u8; 8] {
if self.is_be() { v.to_be_bytes() } else { v.to_le_bytes() }
}
- fn to_u8(&self, v: [u8; 1]) -> u8 {
+ fn de_u8(&self, v: [u8; 1]) -> u8 {
if self.is_be() { u8::from_be_bytes(v) } else { u8::from_le_bytes(v) }
}
- fn to_u16(&self, v: [u8; 2]) -> u16 {
+ fn de_u16(&self, v: [u8; 2]) -> u16 {
if self.is_be() { u16::from_be_bytes(v) } else { u16::from_le_bytes(v) }
}
- fn to_u32(&self, v: [u8; 4]) -> u32 {
+ fn de_u32(&self, v: [u8; 4]) -> u32 {
if self.is_be() { u32::from_be_bytes(v) } else { u32::from_le_bytes(v) }
}
}
@@ -256,7 +256,7 @@ impl<'sig, 'write> Enc<'sig, 'write> {
let mut idx = self.level.idx;
Self::align(self.write, &mut idx, dbus::Element::U8.dvar_alignment_exp())?;
- Self::write(self.write, &mut idx, &self.format.u8(n))?;
+ Self::write(self.write, &mut idx, &self.format.en_u8(n))?;
Self::write(self.write, &mut idx, data.as_bytes())?;
Self::zero(self.write, &mut idx, 1)?;
self.level.idx = idx;
@@ -279,7 +279,7 @@ impl<'sig, 'write> Enc<'sig, 'write> {
let mut idx = self.level.idx;
Self::align(self.write, &mut idx, dbus::Element::U32.dvar_alignment_exp())?;
- Self::write(self.write, &mut idx, &self.format.u32(n))?;
+ Self::write(self.write, &mut idx, &self.format.en_u32(n))?;
Self::write(self.write, &mut idx, data.as_bytes())?;
Self::zero(self.write, &mut idx, 1)?;
self.level.idx = idx;
@@ -289,15 +289,15 @@ impl<'sig, 'write> Enc<'sig, 'write> {
}
pub fn u16(&mut self, data: u16) -> Flow