Rollup merge of #118807 - SUPERCILEX:allo, r=the8472

Remove an allocation in min_stack
This commit is contained in:
Guillaume Gomez 2023-12-11 11:40:37 +01:00 committed by GitHub
commit f712d73108
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ pub fn min_stack() -> usize {
0 => {}
n => return n - 1,
}
let amt = env::var("RUST_MIN_STACK").ok().and_then(|s| s.parse().ok());
let amt = env::var_os("RUST_MIN_STACK").and_then(|s| s.to_str().and_then(|s| s.parse().ok()));
let amt = amt.unwrap_or(imp::DEFAULT_MIN_STACK_SIZE);
// 0 is our sentinel value, so ensure that we'll never see 0 after