File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -17,18 +17,14 @@ const MAX_PATH_LEN: usize = 15;
17
17
18
18
impl ModPath {
19
19
fn starts_with_std ( & self ) -> bool {
20
- self . segments . first ( ) . filter ( | & first_segment| first_segment == & known:: std) . is_some ( )
20
+ self . segments . first ( ) == Some ( & known:: std)
21
21
}
22
22
23
23
// When std library is present, paths starting with `std::`
24
24
// should be preferred over paths starting with `core::` and `alloc::`
25
25
fn can_start_with_std ( & self ) -> bool {
26
- self . segments
27
- . first ( )
28
- . filter ( |& first_segment| {
29
- first_segment == & known:: alloc || first_segment == & known:: core
30
- } )
31
- . is_some ( )
26
+ let first_segment = self . segments . first ( ) ;
27
+ first_segment == Some ( & known:: alloc) || first_segment == Some ( & known:: core)
32
28
}
33
29
34
30
fn len ( & self ) -> usize {
You can’t perform that action at this time.
0 commit comments