rust-lang / rust-lang/rust-analyzer

Code action `inline_bounds` (the opposite of `move_bounds_to_where_clause`)

Open
#14,907 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-assists C-feature
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

I'd like to easily convert this

pub fn serialize<S>(num: u32, serializer: S) -> Result<S::Ok, S::Error>
where
    S: Serializer,
{
    Ok(())
}

to this

pub fn serialize<S: Serializer>(num: u32, serializer: S) -> Result<S::Ok, S::Error> {
    Ok(())
}

basically the opposite of move_bounds_to_where_clause

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing move_bounds_to_where_clause code action and its tests or entry point. Add the inverse transformation so bounds move from the where clause into the generic parameter, and verify the shown Rust example produces the requested form.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.