¿Cómo especifico un tipo que no se puede inferir al usar if let?
Quiero escribir lo siguiente conif let
peroOk(config)
no proporciona el tipo paratoml::from_str
let result: Result<Config, _> = toml::from_str(content.as_str());
match result {
Ok(config) => {}
_ => {}
}
// if let Ok(config) = toml::from_str(content.as_str()) {
//
// }
Lo intentéOk(config: Config)
sin suerte. El tipo de éxito no se infiere.