Commit Graph

11 Commits

Author SHA1 Message Date
rrokkam
45e53e823b Bump to 2018 edition 2020-07-19 13:51:32 -07:00
rrokkam
d897d295b7 Update Cargo.toml; bump version number 2020-07-19 13:51:27 -07:00
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
f21ed2ae13 Make main.rs clippy-clean 2020-07-19 13:51:23 -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
rrokkam
87f3e536a4 Risky: Move tests into mod.rs
Usual Rust practice is to put tests in the same file they are testing.
I don't see any magic in the texttests that would require tests and code
to be in separate files, but I am not entirely sure, so I added the
risky tag.
2020-07-19 13:47:02 -07:00
rrokkam
2a53bf5db5 Delete imports that are already in the prelude
`Vec` and `String` are in the prelude, so qualifying them with
`vec::Vec` and `string::String` is unnecessary.
2020-07-19 13:45:35 -07:00
rrokkam
a699803ce7 cargo fmt
Standard Rust formatting practice
2020-07-19 13:45:01 -07:00
Michael Gerhaeuser
52d3d5607a Add rust version 2015-10-03 21:14:18 +02:00