Skip to content

Commit 49ea4e2

Browse files
committed
Use parse_bool for handling the bools
1 parent 38ce339 commit 49ea4e2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

compiler/rustc_session/src/options.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,11 +1421,13 @@ mod parse {
14211421
slot: &mut Option<FramePointer>,
14221422
v: Option<&str>,
14231423
) -> bool {
1424+
let mut always = false;
14241425
match v {
1425-
Some("always" | "yes" | "y" | "on" | "true") | None => {
1426-
*slot = Some(FramePointer::Always)
1426+
Some(v) if parse_bool(&mut always, Some(v)) => {
1427+
*slot = Some(if always { FramePointer::Always } else { FramePointer::MayOmit })
14271428
}
1428-
Some("never" | "false" | "no" | "n" | "off") => *slot = Some(FramePointer::MayOmit),
1429+
Some("always") | None => *slot = Some(FramePointer::Always),
1430+
Some("never") => *slot = Some(FramePointer::MayOmit),
14291431
Some("non-leaf") => *slot = Some(FramePointer::NonLeaf),
14301432
Some(_) => return false,
14311433
}

0 commit comments

Comments
 (0)