Skip to content

Commit 868cf78

Browse files
committed
Fixed clippy lints
1 parent 3e6216a commit 868cf78

4 files changed

Lines changed: 8 additions & 11 deletions

File tree

src/crypto/attrs/flattened_protected_attributes.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ impl FlattenedProtectedAttribute {
9797
}
9898
}
9999

100-
impl Into<BytesWithDescriptor> for FlattenedProtectedAttribute {
101-
fn into(self) -> BytesWithDescriptor {
102-
BytesWithDescriptor {
103-
bytes: self.plaintext.to_vec(),
104-
descriptor: self.storage_descriptor(),
100+
impl From<FlattenedProtectedAttribute> for BytesWithDescriptor {
101+
fn from(fpa: FlattenedProtectedAttribute) -> Self {
102+
Self {
103+
bytes: fpa.plaintext.to_vec(),
104+
descriptor: fpa.storage_descriptor(),
105105
}
106106
}
107107
}
@@ -150,12 +150,12 @@ impl FlattenedAttrName {
150150
/// Parse a descriptor into a [FlattenedKey].
151151
pub(super) fn parse(descriptor: &str) -> Self {
152152
fn split_subkey(prefix: Option<String>, key: &str) -> FlattenedAttrName {
153-
match key.split_once(".") {
153+
match key.split_once('.') {
154154
None => FlattenedAttrName::new(prefix, key),
155155
Some((key, subkey)) => FlattenedAttrName::new(prefix, key).with_subkey(subkey),
156156
}
157157
}
158-
match descriptor.split_once("/") {
158+
match descriptor.split_once('/') {
159159
None => split_subkey(None, descriptor),
160160
Some((prefix, key)) => split_subkey(Some(prefix.to_string()), key),
161161
}

src/crypto/attrs/normalized_protected_attributes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ impl FromIterator<FlattenedProtectedAttribute> for NormalizedProtectedAttributes
108108
}
109109
acc
110110
})
111-
.into()
112111
}
113112
}
114113

src/crypto/sealed.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ impl SealedTableEntry {
122122
.chunks(chunk_size)
123123
.into_iter()
124124
.map(|fpa| fpa.into_iter().collect::<NormalizedProtectedAttributes>())
125-
.into_iter()
126125
.zip_eq(unprotected_items.into_iter())
127126
.map(|(fpa, unprotected)| Ok(Unsealed::new_from_parts(fpa, unprotected)))
128127
.collect()

src/encrypted_table/table_attribute.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ impl TableAttribute {
4444
EncryptedRecord::from_slice(&s[..])
4545
.map_err(SealError::from)
4646
.and_then(|record| {
47-
// FIXME: Re-enable this check
48-
if true || record.descriptor == descriptor {
47+
if record.descriptor == descriptor {
4948
Ok(record)
5049
} else {
5150
Err(SealError::AssertionFailed(format!(

0 commit comments

Comments
 (0)