From 739b312fddb7b0c34c24925e1019d5ea97f52070 Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Thu, 2 Nov 2023 15:26:47 -0700 Subject: [PATCH] replace into with from into come for free --- src/api.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api.rs b/src/api.rs index 703880d..5a2b2b2 100644 --- a/src/api.rs +++ b/src/api.rs @@ -63,12 +63,12 @@ struct DrinkForm { quantity: u32, } -impl Into for DrinkForm { - fn into(self) -> NewDrink { +impl From for NewDrink { + fn from(value: DrinkForm) -> Self { NewDrink { - price: self.price, - quantity: self.quantity, - shift: self.shift_id, + price: value.price, + quantity: value.quantity, + shift: value.shift_id, } } }