docs: stop using deprecated smallvec! macro in README example - #520
Merged
Conversation
The smallvec! macro has been deprecated since 2.0.0-alpha.13 (note: 'use SmallVec::from instead'). Replace the README example with SmallVec::from([...]) and drop the macro from the use statement. Also strips trailing whitespace on the removed line. Fixes servo#518.
alejandro-vaz
self-requested a review
August 30, 2026 23:54
Collaborator
|
is this ready for review |
Collaborator
|
it looks like to me |
alejandro-vaz
marked this pull request as ready for review
August 30, 2026 23:57
alejandro-vaz
approved these changes
Aug 30, 2026
Collaborator
|
AI contributions are not allowed in any @servo repository https://book.servo.org/contributing/getting-started.html#ai-contributions thanks for contributing |
Collaborator
|
I'm not sure if you're a human being or not, I've received way too many AI PRs recently if you want you can try #491, it's also docs thank you for your contribution |
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.
Fixes #518.
What
The README example still showcased the
smallvec!macro, which has been deprecated since2.0.0-alpha.13(see #445, deprecation notes insrc/lib.rs:use SmallVec::from instead). This PR updates the example to the blessed API:and drops the macro from the
usestatement. It also removes a line of trailing whitespace that was on the old import line.Why
New users copy the README first. Advertising a deprecated macro in the flagship example pushes them toward code that emits deprecation warnings on day one, contradicting the crate's own guidance from #445.
Verification
SmallVec::from([T; M])is provided by the unconditionalimpl<T, const N: usize, const M: usize> From<[T; M]> for SmallVec<T, N>(src/lib.rs, line ~2726) - no feature gate, works inno_stdcore contexts just like the macro did.include_str!-ed into lib.rs), so no test churn; example semantics are unchanged (4 inline elements, spill onpush(5)).Note / possible follow-up
src/lib.rsline ~1903 still usessmallvec![1, 2, 3]inside a doctested example onas_mut_ptr(that one IS compiled by CI). Left out of this PR to keep it docs-only and scoped to #518 - happy to do a follow-up if useful.