diff --git a/src/lib.rs b/src/lib.rs index cf44929..8a9ea01 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -989,8 +989,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()?;