|
|
|
|
|
by phiresky
2015 days ago
|
|
> As an aside, the Rust code could also be written like this Sadly it can't really, because Rust doesn't have control-flow based type refinement like TypeScript.. In TS the type of `file` after the throw is File. In Rust it stays `Option<file>` so you would have to unsafely unwrap it below the if block. |
|