diff --git a/src/lib.rs b/src/lib.rs index c2bd16e..fb9c15f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -953,8 +953,7 @@ impl Version { // // CMake suite maintained and supported by Kitware (kitware.com/cmake). // ``` - let version = s.lines().find(|s| s.starts_with("cmake version "))?; - let version = &version["cmake version ".len()..]; // strip prefix + let version = s.lines().next()?.strip_prefix("cmake version ")? let mut digits = version.splitn(3, '.'); // split version string to major minor patch let major = digits.next()?.parse::().ok()?; let minor = digits.next()?.parse::().ok()?;