File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,13 @@ struct Config {
24
24
match_architectures : Option < Vec < String > > ,
25
25
}
26
26
27
+ impl Config {
28
+ /// Return true if the filename is one we should parse.
29
+ fn filename_matches ( name : & str ) -> bool {
30
+ matches ! ( Utf8Path :: new( name) . extension( ) , Some ( "toml" ) )
31
+ }
32
+ }
33
+
27
34
/// Load and parse all bootc kargs.d files in the specified root, returning
28
35
/// a combined list.
29
36
fn get_kargs_in_root ( d : & Dir , sys_arch : & str ) -> Result < Vec < String > > {
@@ -43,7 +50,7 @@ fn get_kargs_in_root(d: &Dir, sys_arch: &str) -> Result<Vec<String>> {
43
50
let name = name
44
51
. to_str ( )
45
52
. ok_or_else ( || anyhow:: anyhow!( "Invalid non-UTF8 filename: {name:?}" ) ) ?;
46
- if !matches ! ( Utf8Path :: new ( name) . extension ( ) , Some ( "toml" ) ) {
53
+ if !Config :: filename_matches ( name) {
47
54
continue ;
48
55
}
49
56
let buf = d. read_to_string ( name) ?;
@@ -72,9 +79,10 @@ fn get_kargs_from_ostree(
72
79
} else {
73
80
continue ;
74
81
} ;
75
- if !name . ends_with ( ".toml" ) {
82
+ if !Config :: filename_matches ( name ) {
76
83
continue ;
77
84
}
85
+
78
86
let fetched_child = fetched_iter. child ( & fetched_info) ;
79
87
let fetched_child = fetched_child
80
88
. downcast :: < ostree:: RepoFile > ( )
You can’t perform that action at this time.
0 commit comments