rust-lang / rust-lang/rust-analyzer
CodeAction: owned to slice type
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
i.e. convert Vec<T> to &[T] on a function parameter, let binding or struct definition.
fn some_fn(value: Vec|<u8>) {...}
fn some_fn(value: &[u8]) {...}
Not sure if it is possible to access the trait implementations of Borrow or ToOwned or if this could only be implemented for a set of hard-coded types from the std, i.e. Vec, String, OsString, PathBuf ...
Contributor 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.
Research direction
The issue names no files, tests, or entry points. Start by tracing rust-analyzer's CodeAction implementation and determine whether Borrow or ToOwned can drive the conversion, or whether supported standard-library types must be enumerated. Done means the action converts eligible owned types to slice or equivalent borrowed types in the listed contexts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100