-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run Rustfmt, resolve Clippy lints, use 2018 edition (#31)
I do Rust as part of my living, and I wanted to update this codebase to match with the standard way Rust repositories are managed. This PR is mostly running Rustfmt and fixing Clippy errors. These are both invaluable tools I highly recommend you try out if you haven't already. Rustfmt is an autoformatter that not only makes it so there's no conflicting styles, but also makes it really easy to do big refactors without having to care about style too much. VS Code has an option to run a formatter when you save, and if you're using a Rust LSP (RLS or the newer rust-analyzer), then it helps productivity a lot. Clippy is a very good linter that finds issues that the normal rustc doesn't catch. For this repo, it found some style issues and a minor performance issue that were easily fixed up. A lot of the code is inside macros, which clippy and Rustfmt can't introspect very well, but this covers most of it. - Runs cargo fmt* - Fixes error brought up by cargo clippy* - Upgrades to Rust 2018, which is regularly updated - Change `const _: () = "bla"` to `compile_error!("bla")` - Change `use` to be use the idiomatic grouped syntax * - I highly recommend setting up a GitHub action to do these.
- Loading branch information
1 parent
43e14ac
commit 66ce0fe
Showing
17 changed files
with
186 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[package] | ||
name = "rust-g" | ||
edition = "2018" | ||
version = "0.4.5" | ||
authors = ["Bjorn Neergaard <[email protected]>"] | ||
repository = "https://github.com/tgstation/rust-g" | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.