ffmpeg_sidecar::download

Function parse_linux_version

Source
pub fn parse_linux_version(version: &str) -> Option<String>
Expand description

Parse the the Linux version number from a long manifest text file.

Example input: https://johnvansickle.com/ffmpeg/release-readme.txt

use ffmpeg_sidecar::download::parse_linux_version;
let json_string = "build: ffmpeg-5.1.1-amd64-static.tar.xz\nversion: 5.1.1\n\ngcc: 8.3.0";
let parsed = parse_linux_version(&json_string).unwrap();
assert!(parsed == "5.1.1");