extract_version_range in compiletest::directives - Rust
Description: Takes a directive of the form `"<version1> [- <version2>]"`, returns the numeric representation of `<version1>` and `<version2>` as tuple: `(<version1>, <version2>)`.

Skip to main content

## extract_version_range

# Function extract_version_range

Source

    fn extract_version_range<'a, F, VersionTy: Clone>(
        line: &'a str,
        parse: F,
    ) -> Option<(VersionTy, VersionTy)>where
        F: Fn(&'a str) -> Option<VersionTy>,

Expand description

Takes a directive of the form `"<version1> [- <version2>]"`, returns the numeric representation of `<version1>` and `<version2>` as tuple: `(<version1>, <version2>)`.

If the `<version2>` part is omitted, the second component of the tuple is the same as `<version1>`.