Skip to content

Commit c411a37

Browse files
committed
version: Simplify to_cfg by reusing to_feature
1 parent 4752f00 commit c411a37

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/version.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@ pub enum Version {
1212

1313
impl Version {
1414
pub fn to_cfg(self) -> String {
15-
use self::Version::*;
16-
match self {
17-
Full(major, minor, 0) => format!("feature = \"v{}_{}\"", major, minor),
18-
Full(major, minor, patch) => format!("feature = \"v{}_{}_{}\"", major, minor, patch),
19-
Short(major) => format!("feature = \"v{}\"", major),
20-
}
15+
format!("feature = \"{}\"", self.to_feature())
2116
}
2217

2318
pub fn to_feature(self) -> String {

0 commit comments

Comments
 (0)