Skip to content

Commit 895e01c

Browse files
authored
Fix flags.rs
1 parent 5bde8df commit 895e01c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/flags.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ impl<'this> RustcCodegenFlags<'this> {
104104
};
105105
let flag = flag.as_ref();
106106

107-
fn flag_not_empty_inner<T>(
108-
flag: &str,
109-
flag_value: Option<T>,
110-
) -> Result<Option<T>, Error> {
107+
fn flag_not_empty_generic<T>(flag: &str, flag_value: Option<T>) -> Result<Option<T>, Error> {
111108
if let Some(flag_value) = flag_value {
112109
Ok(Some(flag_value))
113110
} else {
@@ -117,7 +114,7 @@ impl<'this> RustcCodegenFlags<'this> {
117114
))
118115
}
119116
}
120-
let flag_not_empty = |flag_value| flag_not_empty_inner(flag, flag_value);
117+
let flag_not_empty = |flag_value| flag_not_empty_generic(flag, flag_value);
121118

122119
match flag {
123120
// https://doc.rust-lang.org/rustc/codegen-options/index.html#code-model
@@ -163,7 +160,7 @@ impl<'this> RustcCodegenFlags<'this> {
163160
// https://doc.rust-lang.org/beta/unstable-book/compiler-flags/dwarf-version.html
164161
// FIXME: Drop the -Z variant and update the doc link once the option is stablized
165162
"-Zdwarf-version" | "-Cdwarf-version" => {
166-
self.dwarf_version = flag_not_empty(value.and_then(arg_to_u32))?;
163+
self.dwarf_version = flag_not_empty_generic(flag, value.and_then(arg_to_u32))?;
167164
}
168165
// https://github.com/rust-lang/rust/issues/114903
169166
// FIXME: Drop the -Z variant and update the doc link once the option is stabilized

0 commit comments

Comments
 (0)