The following code makes the compiler happy, but I wish using tmp_config
weren’t necessary:
impl InlineParser {
pub fn new(config_opt: Option<&InlineParserConfig>) -> Self {
let tmp_config: InlineParserConfig;
let config = match config_opt {
Some(c) => c,
None => {
tmp_config = InlineParserConfig::new();
&tmp_config
},
};
// ···
}
// ···
}