style: updated rustfmt.toml guidelines - #490
Merged
Merged
Conversation
jdm
approved these changes
Aug 30, 2026
| }; | ||
| #[cfg(feature = "std")] | ||
| use std::io; | ||
| use { |
Member
There was a problem hiding this comment.
Personally I am not a fan of this style of writing imports, since they are harder to search for (eg when looking if a dependency is unused) and I find them harder to read. I will defer to you since you're actually working in the code, however.
| const unsafe fn as_ptr_heap(&self) -> *const T { | ||
| self.heap.0.as_ptr() | ||
| } | ||
| const unsafe fn as_ptr_heap(&self) -> *const T { self.heap.0.as_ptr() } |
Member
There was a problem hiding this comment.
I'm not convinced about the value of smashing methods into one line like this because it makes the visual syntactic noise much higher.
Collaborator
Author
There was a problem hiding this comment.
I will revert that one then
Ports the implementation from the v1 branch to the v2 `SmallVec<T, const N>` API, gated behind a new optional `arbitrary` feature. Delegates to `Unstructured::arbitrary_iter` / `arbitrary_take_rest_iter` and collects via the existing `FromIterator` impl. Adds a feature-gated test. Closes servo#494 Signed-off-by: Jorge Polanco <55784702+Jorge-Polanco-Roque@users.noreply.github.com>
Signed-off-by: Alejandro Vaz <alejandro.vaz.myt@gmail.com>
alejandro-vaz
added a commit
to alejandro-vaz/rust-smallvec
that referenced
this pull request
Aug 30, 2026
* fix: refined style * refactor: new style * fix: style * revert: fn single line * Turn all tests into integration tests (servo#495) * Implement arbitrary::Arbitrary for SmallVec (servo#496) Ports the implementation from the v1 branch to the v2 `SmallVec<T, const N>` API, gated behind a new optional `arbitrary` feature. Delegates to `Unstructured::arbitrary_iter` / `arbitrary_take_rest_iter` and collects via the existing `FromIterator` impl. Adds a feature-gated test. Closes servo#494 Signed-off-by: Jorge Polanco <55784702+Jorge-Polanco-Roque@users.noreply.github.com> * docs: told agents to link to servo contributing guidelines (servo#504) * fix: added since and note for deprecations (servo#488) * refactor: new style * revert: fn single line * fix: import errors solved * fix: formatting * fix: style again --------- Signed-off-by: Jorge Polanco <55784702+Jorge-Polanco-Roque@users.noreply.github.com> Signed-off-by: Alejandro Vaz <alejandro.vaz.myt@gmail.com> Co-authored-by: Tobias Decking <Tobias.Decking@gmail.com> Co-authored-by: Jorge Polanco <55784702+Jorge-Polanco-Roque@users.noreply.github.com>
alejandro-vaz
added a commit
to alejandro-vaz/rust-smallvec
that referenced
this pull request
Aug 30, 2026
* fix: cargo warnings * Turn all tests into integration tests (servo#495) * Implement arbitrary::Arbitrary for SmallVec (servo#496) Ports the implementation from the v1 branch to the v2 `SmallVec<T, const N>` API, gated behind a new optional `arbitrary` feature. Delegates to `Unstructured::arbitrary_iter` / `arbitrary_take_rest_iter` and collects via the existing `FromIterator` impl. Adds a feature-gated test. Closes servo#494 Signed-off-by: Jorge Polanco <55784702+Jorge-Polanco-Roque@users.noreply.github.com> * docs: told agents to link to servo contributing guidelines (servo#504) * fix: added since and note for deprecations (servo#488) * style: updated `rustfmt.toml` guidelines (servo#490) * fix: refined style * refactor: new style * fix: style * revert: fn single line * Turn all tests into integration tests (servo#495) * Implement arbitrary::Arbitrary for SmallVec (servo#496) Ports the implementation from the v1 branch to the v2 `SmallVec<T, const N>` API, gated behind a new optional `arbitrary` feature. Delegates to `Unstructured::arbitrary_iter` / `arbitrary_take_rest_iter` and collects via the existing `FromIterator` impl. Adds a feature-gated test. Closes servo#494 Signed-off-by: Jorge Polanco <55784702+Jorge-Polanco-Roque@users.noreply.github.com> * docs: told agents to link to servo contributing guidelines (servo#504) * fix: added since and note for deprecations (servo#488) * refactor: new style * revert: fn single line * fix: import errors solved * fix: formatting * fix: style again --------- Signed-off-by: Jorge Polanco <55784702+Jorge-Polanco-Roque@users.noreply.github.com> Signed-off-by: Alejandro Vaz <alejandro.vaz.myt@gmail.com> Co-authored-by: Tobias Decking <Tobias.Decking@gmail.com> Co-authored-by: Jorge Polanco <55784702+Jorge-Polanco-Roque@users.noreply.github.com> * feat: added borsh serialize (servo#486) * feat: added borsh serialize * fix: formatting * fix: style formatting --------- Signed-off-by: Alejandro Vaz <alejandro.vaz.myt@gmail.com> * feat: implement `Format` for `SmallVec` (servo#472) * feat: added defmt for smallvec * fix: ran formatter * refactor: removed API boundary * fix: ran formatter * fix: renamed imports to avoid namespace conflicts * refactor: simplified format for smallvec * fix: style formatting * fix: imports --------- Signed-off-by: Alejandro Vaz <alejandro.vaz.myt@gmail.com> * fix: cargo warnings --------- Signed-off-by: Jorge Polanco <55784702+Jorge-Polanco-Roque@users.noreply.github.com> Signed-off-by: Alejandro Vaz <alejandro.vaz.myt@gmail.com> Co-authored-by: Tobias Decking <Tobias.Decking@gmail.com> Co-authored-by: Jorge Polanco <55784702+Jorge-Polanco-Roque@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
this PR introduces the following changes to
rustfmt.toml:useblockcargo fmt --checkerrors on overflow and unformattedallowed small functions to be written in a single line of code/* ... */comments to// ...comments?try shortcutwhereclauseseffects
vec!macro because rustfmt confounds the macro with the module, reducing the importsalloc::vec; alloc::vec::Vectoalloc::vec::{self, Vec}which is not validvec!macro means that we use iterator-collection specialization instead