Skip to content

Commit 28bff20

Browse files
committed
fix: clippy issues
Minor issues that started being reported by the recent cargo versions. Signed-off-by: setrofim <[email protected]>
1 parent ec68dee commit 28bff20

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/comid.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl<'a> ConciseMidTag<'a> {
200200
{
201201
let mut raw_bytes = vec![];
202202
ciborium::into_writer(value, &mut raw_bytes)
203-
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?;
203+
.map_err(|e| std::io::Error::other(e.to_string()))?;
204204
let raw_value = TaggedBytes::new(raw_bytes.into());
205205

206206
let measurement = MeasurementMap {
@@ -289,7 +289,7 @@ impl<'a> ConciseMidTag<'a> {
289289
{
290290
let mut raw_bytes = vec![];
291291
ciborium::into_writer(value, &mut raw_bytes)
292-
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?;
292+
.map_err(|e| std::io::Error::other(e.to_string()))?;
293293
let raw_value = TaggedBytes::new(raw_bytes.into());
294294

295295
let measurement = MeasurementMap {
@@ -1464,7 +1464,7 @@ impl Serialize for TriplesMap<'_> {
14641464
let is_human_readable = serializer.is_human_readable();
14651465
let len = map_len!(
14661466
self,
1467-
0 + self.extensions.as_ref().map_or(0, |e| e.len()),
1467+
self.extensions.as_ref().map_or(0, |e| e.len()),
14681468
reference_triples,
14691469
endorsed_triples,
14701470
identity_triples,

src/core.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ impl<'a, 'b> ExtensionMap<'a> {
288288
}
289289
}
290290

291+
#[allow(clippy::len_without_is_empty)]
291292
impl<'a> ExtensionMap<'a> {
292293
pub fn new() -> Self {
293294
Self::default()

src/corim.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ impl<'de> Deserialize<'de> for CorimIdTypeChoice<'_> {
867867
}
868868

869869
/// Types of tags that can be included in a CoRIM
870+
#[allow(clippy::large_enum_variant)]
870871
#[repr(C)]
871872
#[derive(Debug, From, PartialEq, Eq, PartialOrd, Ord, Clone)]
872873
pub enum ConciseTagTypeChoice<'a> {

src/triples.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,7 @@ impl<'de> Deserialize<'de> for ClassIdTypeChoice<'_> {
873873
}
874874

875875
/// Possible types for instance identifiers
876+
#[allow(clippy::large_enum_variant)]
876877
#[derive(Debug, Serialize, From, PartialEq, Eq, PartialOrd, Ord, Clone)]
877878
#[repr(C)]
878879
#[serde(untagged)]
@@ -3387,7 +3388,7 @@ impl Serialize for FlagsMap<'_> {
33873388

33883389
let len = map_len!(
33893390
self,
3390-
0 + self.extensions.as_ref().map_or(0, |e| e.len()),
3391+
self.extensions.as_ref().map_or(0, |e| e.len()),
33913392
is_configured,
33923393
is_secure,
33933394
is_recovery,

0 commit comments

Comments
 (0)