mirror of
https://github.com/tlsnotary/tlsn-utils.git
synced 2026-01-09 12:48:03 -05:00
chore: fix clippy issues + run clippy in CI (#45)
* Chore: fix clippy issues + run clippy in CI * clippy * clippy * clippy * Formatting
This commit is contained in:
@@ -103,16 +103,16 @@ impl NestedId {
|
||||
}
|
||||
}
|
||||
|
||||
impl ToString for NestedId {
|
||||
fn to_string(&self) -> String {
|
||||
impl std::fmt::Display for NestedId {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
NestedId::String { id, root } => match root {
|
||||
Some(root) => format!("{}/{}", root.to_string(), id),
|
||||
None => id.to_string(),
|
||||
Some(root) => write!(f, "{}/{}", root, id),
|
||||
None => write!(f, "{}", id),
|
||||
},
|
||||
NestedId::Counter { value, root } => match root {
|
||||
Some(root) => format!("{}/{}", root.to_string(), value),
|
||||
None => value.to_string(),
|
||||
Some(root) => write!(f, "{}/{}", root, value),
|
||||
None => write!(f, "{}", value),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,7 @@ pub trait DifferenceMut<Rhs> {
|
||||
|
||||
impl<T: Copy + Ord> DifferenceMut<Range<T>> for RangeSet<T> {
|
||||
fn difference_mut(&mut self, other: &Range<T>) {
|
||||
if other.is_empty() {
|
||||
return;
|
||||
} else if self.ranges.is_empty() {
|
||||
if other.is_empty() || self.ranges.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -165,6 +165,7 @@ impl<T: Copy + Ord> BitAnd<&RangeSet<T>> for RangeSet<T> {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::single_range_in_vec_init)]
|
||||
mod tests {
|
||||
use std::collections::HashSet;
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ impl<T: Copy + Ord> Subset<RangeSet<T>> for RangeSet<T> {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::single_range_in_vec_init)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user