mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 04:12:13 +00:00
Use 2018-edition field init shorthand
This commit is contained in:
parent
972e00541a
commit
b9372efe6f
@ -7,9 +7,9 @@ pub struct Item {
|
|||||||
impl Item {
|
impl Item {
|
||||||
pub fn new(name: String, sell_in: i32, quality: i32) -> Item {
|
pub fn new(name: String, sell_in: i32, quality: i32) -> Item {
|
||||||
Item {
|
Item {
|
||||||
name: name,
|
name,
|
||||||
sell_in: sell_in,
|
sell_in,
|
||||||
quality: quality,
|
quality,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -20,7 +20,7 @@ pub struct GildedRose {
|
|||||||
|
|
||||||
impl GildedRose {
|
impl GildedRose {
|
||||||
pub fn new(items: Vec<Item>) -> GildedRose {
|
pub fn new(items: Vec<Item>) -> GildedRose {
|
||||||
GildedRose { items: items }
|
GildedRose { items }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_quality(&mut self) {
|
pub fn update_quality(&mut self) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user