Skip to content

Commit 49a7321

Browse files
committed
Simplify NvvmArch::fmt.
1 parent 2891f7d commit 49a7321

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

crates/nvvm/src/lib.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,7 @@ pub enum NvvmArch {
339339

340340
impl Display for NvvmArch {
341341
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
342-
let raw = format!("{self:?}").to_ascii_lowercase();
343-
// Handle architectures with suffixes (e.g., Compute90a -> compute_90a)
344-
if let Some(pos) = raw.find(|c: char| c.is_ascii_digit()) {
345-
let (prefix, rest) = raw.split_at(pos);
346-
write!(f, "{prefix}_{rest}")
347-
} else {
348-
// Fallback for unexpected format
349-
f.write_str(&raw)
350-
}
342+
f.write_str(&self.target_feature())
351343
}
352344
}
353345

0 commit comments

Comments
 (0)