Skip to content

Commit

Permalink
Update errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertZ2011 committed Jan 15, 2025
1 parent a7b33eb commit fcdecd3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,18 @@ pub enum PdError {
/// Set sink path rejected
SetSinkPath,
/// The requested action has not yet completed
InProgress,
Busy,
/// The requested action timed out
Timeout,
/// Generic failure
Failed,
/// The device is in the incorrect mode
InvalidMode,
}

Check failure on line 55 in src/lib.rs

View workflow job for this annotation

GitHub Actions / stable / clippy (a2026cd5c1003cd467299ef93720bd0d0abdc3f6)

[clippy] reported by reviewdog 🐶 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:55:1 | 55 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 55 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 56 ~ fn from(val: PdError) -> Self { 57 ~ Err(Error::Pd(val)) | Raw Output: src/lib.rs:55:1:e:error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:55:1 | 55 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 55 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 56 ~ fn from(val: PdError) -> Self { 57 ~ Err(Error::Pd(val)) | __END__

Check failure on line 55 in src/lib.rs

View workflow job for this annotation

GitHub Actions / beta / clippy (a2026cd5c1003cd467299ef93720bd0d0abdc3f6)

[clippy] reported by reviewdog 🐶 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:55:1 | 55 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 55 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 56 ~ fn from(val: PdError) -> Self { 57 ~ Err(Error::Pd(val)) | Raw Output: src/lib.rs:55:1:e:error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:55:1 | 55 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 55 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 56 ~ fn from(val: PdError) -> Self { 57 ~ Err(Error::Pd(val)) | __END__

Check failure on line 55 in src/lib.rs

View workflow job for this annotation

GitHub Actions / beta / clippy (45fa9f27c76b4aed9c51123f729f994cfb1a6499)

[clippy] reported by reviewdog 🐶 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:55:1 | 55 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 55 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 56 ~ fn from(val: PdError) -> Self { 57 ~ Err(Error::Pd(val)) | Raw Output: src/lib.rs:55:1:e:error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:55:1 | 55 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 55 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 56 ~ fn from(val: PdError) -> Self { 57 ~ Err(Error::Pd(val)) | __END__

Check failure on line 55 in src/lib.rs

View workflow job for this annotation

GitHub Actions / stable / clippy (45fa9f27c76b4aed9c51123f729f994cfb1a6499)

[clippy] reported by reviewdog 🐶 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:55:1 | 55 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 55 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 56 ~ fn from(val: PdError) -> Self { 57 ~ Err(Error::Pd(val)) | Raw Output: src/lib.rs:55:1:e:error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:55:1 | 55 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 55 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 56 ~ fn from(val: PdError) -> Self { 57 ~ Err(Error::Pd(val)) | __END__
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
/// Top-level error type
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Error<BE> {

Check failure on line 59 in src/lib.rs

View workflow job for this annotation

GitHub Actions / stable / clippy (a7b33ebc1d1e38644a96e66fc261d02901528819)

[clippy] reported by reviewdog 🐶 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:59:1 | 59 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 59 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 60 ~ fn from(val: PdError) -> Self { 61 ~ Err(Error::Pd(val)) | Raw Output: src/lib.rs:59:1:e:error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:59:1 | 59 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 59 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 60 ~ fn from(val: PdError) -> Self { 61 ~ Err(Error::Pd(val)) | __END__

Check failure on line 59 in src/lib.rs

View workflow job for this annotation

GitHub Actions / beta / clippy (a7b33ebc1d1e38644a96e66fc261d02901528819)

[clippy] reported by reviewdog 🐶 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:59:1 | 59 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 59 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 60 ~ fn from(val: PdError) -> Self { 61 ~ Err(Error::Pd(val)) | Raw Output: src/lib.rs:59:1:e:error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:59:1 | 59 | impl<T, BE> Into<Result<T, Error<BE>>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `-F clippy::from-over-into` implied by `-F clippy::style` help: replace the `Into` implementation with `From<PdError>` | 59 ~ impl<T, BE> From<PdError> for Result<T, Error<BE>> { 60 ~ fn from(val: PdError) -> Self { 61 ~ Err(Error::Pd(val)) | __END__
/// Bus error
Bus(BE),

Check failure on line 61 in src/lib.rs

View workflow job for this annotation

GitHub Actions / stable / clippy (a2026cd5c1003cd467299ef93720bd0d0abdc3f6)

[clippy] reported by reviewdog 🐶 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:61:1 | 61 | impl<BE> Into<Error<BE>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into help: replace the `Into` implementation with `From<PdError>` | 61 ~ impl<BE> From<PdError> for Error<BE> { 62 ~ fn from(val: PdError) -> Self { 63 ~ Error::Pd(val) | Raw Output: src/lib.rs:61:1:e:error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:61:1 | 61 | impl<BE> Into<Error<BE>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into help: replace the `Into` implementation with `From<PdError>` | 61 ~ impl<BE> From<PdError> for Error<BE> { 62 ~ fn from(val: PdError) -> Self { 63 ~ Error::Pd(val) | __END__

Check failure on line 61 in src/lib.rs

View workflow job for this annotation

GitHub Actions / beta / clippy (a2026cd5c1003cd467299ef93720bd0d0abdc3f6)

[clippy] reported by reviewdog 🐶 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:61:1 | 61 | impl<BE> Into<Error<BE>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into help: replace the `Into` implementation with `From<PdError>` | 61 ~ impl<BE> From<PdError> for Error<BE> { 62 ~ fn from(val: PdError) -> Self { 63 ~ Error::Pd(val) | Raw Output: src/lib.rs:61:1:e:error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:61:1 | 61 | impl<BE> Into<Error<BE>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into help: replace the `Into` implementation with `From<PdError>` | 61 ~ impl<BE> From<PdError> for Error<BE> { 62 ~ fn from(val: PdError) -> Self { 63 ~ Error::Pd(val) | __END__

Check failure on line 61 in src/lib.rs

View workflow job for this annotation

GitHub Actions / beta / clippy (45fa9f27c76b4aed9c51123f729f994cfb1a6499)

[clippy] reported by reviewdog 🐶 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:61:1 | 61 | impl<BE> Into<Error<BE>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into help: replace the `Into` implementation with `From<PdError>` | 61 ~ impl<BE> From<PdError> for Error<BE> { 62 ~ fn from(val: PdError) -> Self { 63 ~ Error::Pd(val) | Raw Output: src/lib.rs:61:1:e:error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:61:1 | 61 | impl<BE> Into<Error<BE>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into help: replace the `Into` implementation with `From<PdError>` | 61 ~ impl<BE> From<PdError> for Error<BE> { 62 ~ fn from(val: PdError) -> Self { 63 ~ Error::Pd(val) | __END__

Check failure on line 61 in src/lib.rs

View workflow job for this annotation

GitHub Actions / stable / clippy (45fa9f27c76b4aed9c51123f729f994cfb1a6499)

[clippy] reported by reviewdog 🐶 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:61:1 | 61 | impl<BE> Into<Error<BE>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into help: replace the `Into` implementation with `From<PdError>` | 61 ~ impl<BE> From<PdError> for Error<BE> { 62 ~ fn from(val: PdError) -> Self { 63 ~ Error::Pd(val) | Raw Output: src/lib.rs:61:1:e:error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/lib.rs:61:1 | 61 | impl<BE> Into<Error<BE>> for PdError { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into help: replace the `Into` implementation with `From<PdError>` | 61 ~ impl<BE> From<PdError> for Error<BE> { 62 ~ fn from(val: PdError) -> Self { 63 ~ Error::Pd(val) | __END__
Expand Down

0 comments on commit fcdecd3

Please sign in to comment.