Skip to content

Commit 3be218c

Browse files
committed
Use parse_bool for handling the bools
1 parent 38ce339 commit 3be218c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_session/src/options.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,11 +1421,11 @@ 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+
v @ (None | Some(_)) if parse_bool(&mut always, v) => {
1427+
*slot = Some(if always { FramePointer::Always } else { FramePointer::MayOmit })
14271428
}
1428-
Some("never" | "false" | "no" | "n" | "off") => *slot = Some(FramePointer::MayOmit),
14291429
Some("non-leaf") => *slot = Some(FramePointer::NonLeaf),
14301430
Some(_) => return false,
14311431
}

0 commit comments

Comments
 (0)