pot-rs 0.5.0

Utility modules and functions useful to interact with the pot framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::str::FromStr;

pub(crate) fn get_value<T>(line: &str) -> Option<T>
where
    T: FromStr,
{
    match line.split('=').nth(1) {
        Some(value) => match value.split(' ').next() {
            Some(value) => value.parse().ok(),
            None => None,
        },
        None => None,
    }
}