replace into with from
into come for free
This commit is contained in:
parent
6ed5be6467
commit
739b312fdd
1 changed files with 5 additions and 5 deletions
10
src/api.rs
10
src/api.rs
|
@ -63,12 +63,12 @@ struct DrinkForm {
|
||||||
quantity: u32,
|
quantity: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Into<NewDrink> for DrinkForm {
|
impl From<DrinkForm> for NewDrink {
|
||||||
fn into(self) -> NewDrink {
|
fn from(value: DrinkForm) -> Self {
|
||||||
NewDrink {
|
NewDrink {
|
||||||
price: self.price,
|
price: value.price,
|
||||||
quantity: self.quantity,
|
quantity: value.quantity,
|
||||||
shift: self.shift_id,
|
shift: value.shift_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue