Created
March 3, 2018 16:59
-
-
Save dherman/b9a51cc154a913a851c89f63126f6510 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn extract_usage(s: &str) -> &str { | |
let (start, _) = s.match_indices("Usage:").next().unwrap(); | |
let s = &s[start..]; | |
let (end, _) = s.match_indices("\n\n").next().unwrap(); | |
let s = &s[..end]; | |
s.trim() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment