Skip to content

Commit 41da9b0

Browse files
committed
Use derive(Default) for NvvmArch.
It's possible with the `#[default]` attribute.
1 parent b3b4dea commit 41da9b0

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

crates/nvvm/src/lib.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,12 @@ impl FromStr for NvvmOption {
254254
}
255255

256256
/// Nvvm architecture, default is `Compute52`
257-
#[derive(Debug, Clone, Copy, PartialEq, Eq, strum::EnumIter)]
257+
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, strum::EnumIter)]
258258
pub enum NvvmArch {
259259
Compute35,
260260
Compute37,
261261
Compute50,
262+
#[default]
262263
Compute52,
263264
Compute53,
264265
Compute60,
@@ -346,12 +347,6 @@ impl FromStr for NvvmArch {
346347
}
347348
}
348349

349-
impl Default for NvvmArch {
350-
fn default() -> Self {
351-
Self::Compute52
352-
}
353-
}
354-
355350
impl NvvmArch {
356351
/// Get the numeric capability value (e.g., 35 for Compute35)
357352
pub fn capability_value(&self) -> u32 {

0 commit comments

Comments
 (0)