Skip to content

Commit

Permalink
Merge pull request #1720 from snpkx/master
Browse files Browse the repository at this point in the history
Fix example in from_into.md
  • Loading branch information
marioidival authored Jun 16, 2023
2 parents a6fd482 + b4989d6 commit 469dc16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/conversion/from_into.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ convert into as the compiler is unable to determine this most of the time.
However this is a small trade-off considering we get the functionality for free.

```rust,editable
use std::convert::From;
use std::convert::Into;
#[derive(Debug)]
struct Number {
value: i32,
}
impl From<i32> for Number {
fn from(item: i32) -> Self {
Number { value: item }
impl Into<Number> for i32 {
fn into(self) -> Number {
Number { value: self }
}
}
Expand Down

0 comments on commit 469dc16

Please sign in to comment.