Skip to content

Commit

Permalink
Tweak MetainfoDecode error message
Browse files Browse the repository at this point in the history
Tweak the `MetainfoDecode` error message to make it different from the
`MetainfoDeserialize` error message. It's a fine distinction, but the
`MetainfoDeserialize` error message happens on any serde error when
deserializing, whereas the `MetainfoDecode` error message happens when
encountering invalid bencode.

Also placate Clippy by disabling `clippy::needless_lifetimes` lint.

type: reform
  • Loading branch information
casey committed Jan 7, 2021
1 parent a7e0995 commit 76ea6e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub(crate) enum Error {
},
#[snafu(display("Failed to serialize torrent metainfo: {}", source))]
MetainfoSerialize { source: bendy::serde::Error },
#[snafu(display("Failed to decode torrent metainfo from {}: {}", input, error))]
#[snafu(display("Failed to decode metainfo bencode from {}: {}", input, error))]
MetainfoDecode {
input: InputTarget,
error: bendy::decoding::Error,
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
clippy::map_unwrap_or,
clippy::missing_docs_in_private_items,
clippy::missing_inline_in_public_items,
clippy::needless_lifetimes,
clippy::needless_pass_by_value,
clippy::non_ascii_literal,
clippy::pattern_type_mismatch,
Expand Down

0 comments on commit 76ea6e5

Please sign in to comment.