@@ -28,8 +28,8 @@ pub enum Error {
28
28
The existing volumeMount is {existing_volume_mount:?}, the new one is {new_volume_mount:?}"
29
29
) ) ]
30
30
ClashingVolumeMountMountPath {
31
- existing_volume_mount : VolumeMount ,
32
- new_volume_mount : VolumeMount ,
31
+ existing_volume_mount : Box < VolumeMount > ,
32
+ new_volume_mount : Box < VolumeMount > ,
33
33
} ,
34
34
}
35
35
@@ -539,21 +539,17 @@ mod tests {
539
539
"lengthexceededlengthexceededlengthexceededlengthexceededlengthex" ;
540
540
assert_eq ! ( long_container_name. len( ) , 64 ) ; // 63 characters is the limit for container names
541
541
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 {
547
543
container_name,
548
544
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
+ )
557
553
}
558
554
// One characters shorter name is valid
559
555
let max_len_container_name: String = long_container_name. chars ( ) . skip ( 1 ) . collect ( ) ;
@@ -617,17 +613,13 @@ mod tests {
617
613
result : Result < ContainerBuilder , Error > ,
618
614
expected_err_contains : & str ,
619
615
) {
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 {
625
617
container_name : _,
626
618
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 ) ) ) ;
631
623
}
632
624
}
633
625
}
0 commit comments