mirror of https://github.com/sunface/rust-course
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
185 B
10 lines
185 B
3 years ago
|
## unknown `into` behavior
|
||
|
|
||
|
```rust
|
||
|
let s: Box<dyn Error + Send + Sync> = "connection reset by peer".into();
|
||
|
```
|
||
|
|
||
|
this works because:
|
||
|
```rust
|
||
|
impl From<&'_ str> for Box<dyn Error>
|
||
|
```
|