]> git.lizzy.rs Git - rust.git/commit
try_err: Consider Try impl for Poll when generating suggestions
authorTomasz Miąsko <tomasz.miasko@gmail.com>
Sun, 2 Aug 2020 00:00:00 +0000 (00:00 +0000)
committerTomasz Miąsko <tomasz.miasko@gmail.com>
Mon, 3 Aug 2020 18:48:18 +0000 (20:48 +0200)
commite9677105bf85a2b0c57e8d67d2ed22a286333033
treef317fbf97198bc98169216d6989209e3c5d0e453
parentbbbc973a842fc515f9b22d10d103bbf2d7827697
try_err: Consider Try impl for Poll when generating suggestions

There are two different implementation of Try trait for Poll type;
Poll<Result<T, E>> and Poll<Option<Result<T, E>>>. Take them into
account when generating suggestions.

For example, for Err(e)? suggest either return Poll::Ready(Err(e)) or
return Poll::Ready(Some(Err(e))) as appropriate.
clippy_lints/src/try_err.rs
clippy_lints/src/utils/paths.rs
tests/ui/try_err.fixed
tests/ui/try_err.rs
tests/ui/try_err.stderr