chore(all): fix new lints

This commit is contained in:
Mayeul@Zama
2024-09-06 16:33:00 +02:00
committed by mayeul-zama
parent d6f8e59394
commit 38b5759e88
8 changed files with 36 additions and 24 deletions

View File

@@ -49,6 +49,7 @@ pub trait VersionizeOwned {
}
/// This trait is used as a proxy to be more felxible when deriving Versionize for Vec<T>.
///
/// This way, we can chose to skip versioning Vec<T> if T is a native types but still versionize in
/// a loop if T is a custom type.
/// This is used as a workaround for feature(specialization) and to bypass the orphan rule.
@@ -154,9 +155,10 @@ impl From<Infallible> for UnversionizeError {
}
}
/// This trait means that we can convert from a versioned enum into the target type. This trait
/// can only be implemented on Owned/static types, whereas `Versionize` can also be implemented
/// on reference types.
/// This trait means that we can convert from a versioned enum into the target type.
///
/// This trait can only be implemented on Owned/static types, whereas `Versionize` can also be
/// implemented on reference types.
pub trait Unversionize: VersionizeOwned + Sized {
/// Creates an object from a versioned enum, and eventually upgrades from previous
/// variants.

View File

@@ -59,9 +59,9 @@ fn test_types() {
aligned_box: ABox::new(0, -98765),
aligned_vec: AVec::from_slice(0, &[1, 2, 3, 4]),
never: (),
tuple: (3.14, 2.71),
set: HashSet::from_iter([1, 2, 3].into_iter()),
map: HashMap::from_iter([('t', true), ('e', false), ('s', true)].into_iter()),
tuple: (std::f32::consts::PI, std::f64::consts::E),
set: HashSet::from_iter([1, 2, 3]),
map: HashMap::from_iter([('t', true), ('e', false), ('s', true)]),
};
let mut ser = Vec::new();