Skip to content

Commit 4709c78

Browse files
committed
add negative cases
1 parent 91dacd3 commit 4709c78

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/lib.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,17 @@ pub fn get_version() -> String {
4444
}
4545

4646
pub fn build_info() -> String {
47-
let mut flags = vec![env!("PROFILE")];
48-
if let Some(rust_flags) = option_env!("RUSTFLAGS") {
49-
if rust_flags.contains("-Cprofile-use=") {
50-
flags.push("pgo");
51-
}
52-
}
53-
if cfg!(feature = "mimalloc") {
54-
flags.push("mimalloc");
55-
}
56-
flags.join(" ")
47+
let pgo = if option_env!("RUSTFLAGS").unwrap_or("").contains("-Cprofile-use=") {
48+
"pgo"
49+
} else {
50+
"no-pgo"
51+
};
52+
let allocator = if cfg!(feature = "mimalloc") {
53+
"mimalloc"
54+
} else {
55+
"std-allocator"
56+
};
57+
format!("{} {pgo} {allocator}", env!("PROFILE"))
5758
}
5859

5960
#[pymodule]

0 commit comments

Comments
 (0)