grpc / grpc/grpc-rust

Clippy warning: this could be a `const fn` on fn returning Self

Open
#1,350 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
12.5k
Forks
1.3k
Avg merge
4d 7h
Merged PRs (30d)
24

Description

## Bug Report

### Version

`v0.9.1`

### Platform

Darwin Kernel Version 22.4.0

### Crates

`tonic-build`

### Description

After upgrading from v0.8.4 to v0.9.1 , seeing that the generated function below is being flagged by clippy as could be const.

```
error: this could be a `const fn`
--> /vector/target/debug/build/vector-16666aff764888ca/out/google.pubsub.v1.rs:423:9
|
423 | / pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
424 | | self.max_decoding_message_size = Some(limit);
425 | | self
426 | | }
| |_________^
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.