Skip to content

Commit 9f39907

Browse files
committed
When parsing HDF5 version, accept “_*” suffix
1 parent 50c236f commit 9f39907

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

libhdf5-sys/build.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@ pub struct Version {
2222

2323
impl Version {
2424
pub fn new(major: u8, minor: u8, micro: u8) -> Self {
25-
Self {
26-
major,
27-
minor,
28-
micro,
29-
// TODO: patch level (1.10.2_1)
30-
}
25+
Self { major, minor, micro }
3126
}
3227

3328
pub fn parse(s: &str) -> Option<Self> {
3429
let s = s.lines().next()?.trim();
30+
let s = s.rfind('_').map(|i| &s[..i]).unwrap_or(s);
3531
let mut parts = s.split('.');
3632
let v = Self::new(
3733
parts.next()?.parse().ok()?,

0 commit comments

Comments
 (0)