correct `From<SmallVec<T, N, A>> for Box<[T]>` implementation
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Start in conversions.rs and compare the existing conversion with other allocator-aware implementations. Update the SmallVec-to-box conversion so the allocator is preserved without an intermediate Vec, then verify the resulting Box uses the original allocator and add or adjust focused coverage for this conversion.
Written by the indexing model from the issue text.
Description
the current implementation on conversions.rs:
impl<T, const N: usize, A: Allocator> From<SmallVec<T, N, A>> for Box<[T]> {
fn from(this: SmallVec<T, N, A>) -> Self {
Vec::from(this).into_boxed_slice()
}
}
first converts it to a Vec and changes the allocator before converting it into a box in Global
the correct implementation should preserve the allocator and not make use of an intermediary Vec:
impl<T, const N: usize, A: Allocator> From<SmallVec<T, N, A>> for Box<[T], A>
- Dominant language
- Rust
- Stars
- 1.7k
- Forks
- 225
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 64
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from servo/rust-smallvec
-
good first issue help wanted r-feature
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
servo/rust-smallvec#716 ·
Maintainers usually reply within 1 day
-
deprecate `from_vec`Opengood first issue help wanted r-refactor
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
servo/rust-smallvec#712 · 1 comment ·
Maintainers usually reply within 1 day
-
allocator expansion for `From<Vec<T>>` to `From<Vec<T, A>>`Possibly taken @bolshoytoster claimed this 1 day ago. Opengood first issue help wanted r-feature
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
servo/rust-smallvec#702 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Allocators are stable on nightly RustPossibly taken @GauravPawar101 claimed this 3 days ago. Opengood first issue help wanted r-docs
Difficulty 1/5 Under an hour Newbie friendliness 70/100
servo/rust-smallvec#662 · 3 comments · 3 reactions · 1 assignee ·
Maintainers usually reply within 1 day
-
good first issue help wanted r-refactor
Difficulty 5/5 Over a week Newbie friendliness 35/100
servo/rust-smallvec#731 · 4 comments ·
Maintainers usually reply within 1 day
All issues in servo/rust-smallvec
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
install: root SSH tmpfiles.d drop-in is labeled etc_runtime_t instead of etc_tPossibly taken @andrewdunndev claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
[Misdetection] `text/tab-separated-values` file misdetected as `text/tsv`Possibly taken @bact claimed this today. Openmisdetection needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
C-bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
vxc prints a debug line '[flat-codegen] emitted module via the flat path' on every compilePossibly taken @YodHeVauHe claimed this today. Opendevex good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day