Afraid this might have been the case, if Ogeon’s suggestion doesn’t work out, I’ll probably end up with multiple getters, one per type. There aren’t that many anyway
Thank you!
Afraid this might have been the case, if Ogeon’s suggestion doesn’t work out, I’ll probably end up with multiple getters, one per type. There aren’t that many anyway
Thank you!
Correct, I would want the caller to know what they’re getting, I’ll see if this works, Thank you!
Yep, I’m 36, mid Atlantic US, started driving stick when I was 18. I inherited this little Geo Metro for college, so it was learn stick or no car. (I really liked that car dispite it not having air conditioning, no tachometer, and manual everything)
Next car I bought was a manual. Now since my spouse can’t drive stick we only have automatics.
Whenever we need a new car it’ll be electric, which unfortunately (by design) are not manuals. So no more stick for me.
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(); }