[ 
https://issues.apache.org/jira/browse/AVRO-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17495521#comment-17495521
 ] 

ASF subversion and git services commented on AVRO-3410:
-------------------------------------------------------

Commit cbbb957a2fa0944b6fca4a0eba02e9fba7496859 in avro's branch 
refs/heads/branch-1.11 from Martin Tzvetanov Grigorov
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=cbbb957 ]

AVRO-3410: [Rust] lint failure

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
(cherry picked from commit 5d3f9a687484aac766783442f45fc66d02df530e)


> [Rust] lint failure
> -------------------
>
>                 Key: AVRO-3410
>                 URL: https://issues.apache.org/jira/browse/AVRO-3410
>             Project: Apache Avro
>          Issue Type: Bug
>            Reporter: Ryan Skraba
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Major
>
>  
> {code:java}
>     Checking criterion v0.3.5
> error: this function's return value is unnecessarily wrapped by `Result`
>    --> src/reader.rs:192:5
>     |
> 192 | /     fn read_codec(&mut self, metadata: &HashMap<String, Value>) -> 
> AvroResult<()> {
> 193 | |         if let Some(codec) = metadata
> 194 | |             .get("avro.codec")
> 195 | |             .and_then(|codec| {
> ...   |
> 206 | |         Ok(())
> 207 | |     }
>     | |_____^
>     |
>     = note: `-D clippy::unnecessary-wraps` implied by `-D clippy::all`
>     = help: for further information visit 
> https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
> help: remove `Result` from the return type...
>     |
> 192 |     fn read_codec(&mut self, metadata: &HashMap<String, Value>) -> () {
>     |                                                                    ^^
> help: ...and change the returning expressions
>     |
> 206 |         ()
>     |error: this function's return value is unnecessarily wrapped by `Result`
>    --> src/reader.rs:209:5
>     |
> 209 | /     fn read_user_metadata(&mut self, key: String, value: Value) -> 
> AvroResult<()> {
> 210 | |         match value {
> 211 | |             Value::Bytes(ref vec) => {
> 212 | |                 self.user_metadata.insert(key, vec.clone());
> ...   |
> 222 | |         }
> 223 | |     }
>     | |_____^
>     |
>     = help: for further information visit 
> https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
> help: remove `Result` from the return type...
>     |
> 209 |     fn read_user_metadata(&mut self, key: String, value: Value) -> () {
>     |                                                                    ^^
> help: ...and change the returning expressions
>     |
> 213 |                 ()
> 214 |             }
> 215 |             wrong => {
> 216 |                 warn!(
> 217 |                     "User metadata values must be Value::Bytes, found 
> {:?}",
> 218 |                     wrong
>   ...error: aborting due to 2 previous errorserror: could not compile 
> `apache-avro`
>  {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to