Skip to content

Commit 1882e2f

Browse files
committed
clippy
1 parent 5b25c0d commit 1882e2f

File tree

1 file changed

+16
-24
lines changed

1 file changed

+16
-24
lines changed

crates/stackable-operator/src/builder/pod/container.rs

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ pub enum Error {
2828
The existing volumeMount is {existing_volume_mount:?}, the new one is {new_volume_mount:?}"
2929
))]
3030
ClashingVolumeMountMountPath {
31-
existing_volume_mount: VolumeMount,
32-
new_volume_mount: VolumeMount,
31+
existing_volume_mount: Box<VolumeMount>,
32+
new_volume_mount: Box<VolumeMount>,
3333
},
3434
}
3535

@@ -539,21 +539,17 @@ mod tests {
539539
"lengthexceededlengthexceededlengthexceededlengthexceededlengthex";
540540
assert_eq!(long_container_name.len(), 64); // 63 characters is the limit for container names
541541
let result = ContainerBuilder::new(long_container_name);
542-
match result
543-
.err()
544-
.expect("Container name exceeding 63 characters should cause an error")
545-
{
546-
Error::InvalidContainerName {
542+
if let Error::InvalidContainerName {
547543
container_name,
548544
source,
549-
} => {
550-
assert_eq!(container_name, long_container_name);
551-
assert_eq!(
552-
source.to_string(),
553-
"input is 64 bytes long but must be no more than 63"
554-
)
555-
}
556-
_ => {}
545+
} = result
546+
.err()
547+
.expect("Container name exceeding 63 characters should cause an error") {
548+
assert_eq!(container_name, long_container_name);
549+
assert_eq!(
550+
source.to_string(),
551+
"input is 64 bytes long but must be no more than 63"
552+
)
557553
}
558554
// One characters shorter name is valid
559555
let max_len_container_name: String = long_container_name.chars().skip(1).collect();
@@ -617,17 +613,13 @@ mod tests {
617613
result: Result<ContainerBuilder, Error>,
618614
expected_err_contains: &str,
619615
) {
620-
match result
621-
.err()
622-
.expect("Container name exceeding 63 characters should cause an error")
623-
{
624-
Error::InvalidContainerName {
616+
if let Error::InvalidContainerName {
625617
container_name: _,
626618
source,
627-
} => {
628-
assert!(dbg!(source.to_string()).contains(dbg!(expected_err_contains)));
629-
}
630-
_ => {}
619+
} = result
620+
.err()
621+
.expect("Container name exceeding 63 characters should cause an error") {
622+
assert!(dbg!(source.to_string()).contains(dbg!(expected_err_contains)));
631623
}
632624
}
633625
}

0 commit comments

Comments
 (0)