Add rustfmt.toml configuration and re-format everything + fix basic warnings #279
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So that contributions from multiple people are more consistent w.r.t. code style and formatting 🙂
Note, that this one does not include all of the
cargo clippy
fixes since there are quite a few of them that require manual intervention. I did not want to make them part of this PR (since unlike the rest of the changes these would not be automated, hence would require a more rigorous review of whether the user-written code changes anything).Also,
cargo check
still produces 3 warnings that I did not fix as they would need some minor changes:RemoteTrackPublication::on_subscription_status_changed
andRemoteTrackPublication::on_permission_status_changed
arepub(crate)
and never used within a crate. I was not sure if I'm allowed to remove them (since we don't use them) or if I need to make thempub
(that would require making the rest of the thingspub
as well, for consistency).RtcSession::publisher()
ispub
, but never used (not sure why it complains about it given that it ispub
, perhaps it's never exported or something).Also I added a tiny simple job to check the formatting so that we can keep it consistent.