tokio-rs / prost

PROST! a Protocol Buffers implementation for the Rust Language
Apache License 2.0
3.87k stars 501 forks source link

Clippy warning of unwrap usage in generated code #1170

Open bittermandel opened 4 days ago

bittermandel commented 4 days ago

I've been trying every method possible to ignore the unwrap usage in the generated tonic servers, but I can't seem to achieve it.

I include the generated files like this:

pub mod valv {
    pub mod proto {
        pub mod v1 {
            #![allow(clippy::unwrap_used)]
            include!("gen/valv.v1.rs");
        }
    }
}

valv.v1.rs has a include!("valv.v1.tonic.rs"); call in the bottom of it, which is the file that actually has the unwrap call. Allowing unwrap_used works for valv.v1.rs, but the tonic file will still warn.

Is there a way to make Prost add clippy annotations in files, or in some other way add annotations when including code?