From b4989d6ee1cc8e3df6d59e94db993f451e1c950a Mon Sep 17 00:00:00 2001 From: Kyle Park Date: Thu, 15 Jun 2023 17:58:11 +0900 Subject: [PATCH] fix example in from_into.md --- src/conversion/from_into.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conversion/from_into.md b/src/conversion/from_into.md index 47b327142d..d927cdd78e 100644 --- a/src/conversion/from_into.md +++ b/src/conversion/from_into.md @@ -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 for Number { - fn from(item: i32) -> Self { - Number { value: item } +impl Into for i32 { + fn into(self) -> Number { + Number { value: self } } }