Azure / Azure/azure-sdk-tools

[Rust APIView] Builder method is rendered with `&self` instead of consuming `self`

Open
#15,602 0 comments 0 reactions 0 assignees View on GitHub
APIView customer-reported question Rust
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 2h
Merged PRs (30d)
130

Description

Bad code snippet:
```Rust
pub fn with_indexing_policy(&self, indexing_policy: IndexingPolicy) -> Self {}
```

What it should do:
The APIView rendering is misrepresenting the method signature. This is a parser/rendering bug and should be corrected so the code is displayed accurately.

Good code snippet:
```Rust
pub fn with_indexing_policy(mut self, indexing_policy: IndexingPolicy) -> Self {}
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the Rust APIView parser and renderer entry points responsible for method receivers. Compare how the bad `&self` signature and the expected consuming `self` signature are parsed and rendered. Done means the `with_indexing_policy` example is displayed with `mut self` as shown in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.