Comment on Return Generic Type in Rust

wulf@lemmy.world ⁨8⁩ ⁨months⁩ ago

SOLUTION:

Here is the solution I came up with:

pub struct Configuration {}

impl Configuration {
    fn get std::str::FromStr>() -> Result {
        Ok(T::from_str("1234");
    }
}

fn main() {
    let my_conf_val = Configuration::get();
}

source
Sort:hotnewtop