Skip to content

Commit 79ba6e5

Browse files
test-runner: Simplify an iterator chain
1 parent 5e4752d commit 79ba6e5

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

uefi-test-runner/src/proto/device_path.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use alloc::string::{String, ToString};
1+
use alloc::string::ToString;
22
use alloc::vec::Vec;
33
use uefi::prelude::*;
44
use uefi::proto::device_path::text::*;
@@ -93,16 +93,7 @@ pub fn test(image: Handle, bt: &BootServices) {
9393
"HD(1,MBR,0xBE1AFDFA,0x3F,0xFBFC1)",
9494
"\\efi\\boot\\test_runner.efi",
9595
];
96-
let expected_device_path_str =
97-
expected_device_path_str_components
98-
.iter()
99-
.fold(String::new(), |mut acc, next| {
100-
if !acc.is_empty() {
101-
acc.push('/');
102-
}
103-
acc.push_str(next);
104-
acc
105-
});
96+
let expected_device_path_str = expected_device_path_str_components.join("/");
10697

10798
assert_eq!(
10899
path_components.as_slice(),

0 commit comments

Comments
 (0)