Skip to content
Update rust error authored by umaumax's avatar umaumax
...@@ -266,4 +266,10 @@ fn main() -> Result<(), std::io::Error> { ...@@ -266,4 +266,10 @@ fn main() -> Result<(), std::io::Error> {
} }
Ok(()) Ok(())
} }
```
## 型変換
### `Box<dyn std::error::Error>` to `anyhow::Error`
``` rust
box_error.map_err(|e| anyhow::anyhow!("{}", e))?;
``` ```
\ No newline at end of file