Skip to content

Commit

Permalink
Merge 0e7611a into 7fefb4a
Browse files Browse the repository at this point in the history
  • Loading branch information
ia0 committed Jan 28, 2021
2 parents 7fefb4a + 0e7611a commit 990d50c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### Patch

- Remove the `std` feature for `Display`

## 2.3.1

### Patch
Expand Down
10 changes: 4 additions & 6 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,8 @@ pub enum DecodeKind {
Padding,
}

#[cfg(feature = "std")]
impl std::fmt::Display for DecodeKind {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
impl core::fmt::Display for DecodeKind {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
let description = match self {
DecodeKind::Length => "invalid length",
DecodeKind::Symbol => "invalid symbol",
Expand All @@ -318,9 +317,8 @@ pub struct DecodeError {
#[cfg(feature = "std")]
impl std::error::Error for DecodeError {}

#[cfg(feature = "std")]
impl std::fmt::Display for DecodeError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
impl core::fmt::Display for DecodeError {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "{} at {}", self.kind, self.position)
}
}
Expand Down

0 comments on commit 990d50c

Please sign in to comment.