Commit Graph

4 Commits

Author SHA1 Message Date
rrokkam
2ebbc987fb Make Item::new take Into<String> as a name
This clears a lot of Rust-specific String boilerplate, so it's not
necessary to type String::from("foo") every time we want an item
with name "foo". It also makes the code look more similar to the C#
version of the code.

I am leaving the public struct members in because those are more
similar to the matching code in the other languages' implementations.
2020-07-19 13:51:27 -07:00
rrokkam
c88bdfd53e Implement Display for Item
This is a more idiomatic way of printing the contents of an object
than reaching into its innards. It is also more 1-1 with the original
C# code, which overrides toString for Item.
2020-07-19 13:51:27 -07:00
rrokkam
b9372efe6f Use 2018-edition field init shorthand 2020-07-19 13:50:50 -07:00
rrokkam
972e00541a Move gildedrose/mod.rs -> gildedrose.rs
Avoiding putting simple one-file modules in their own folder.
2020-07-19 13:49:13 -07:00