Skip to content

Commit

Permalink
Derive Clone for error types
Browse files Browse the repository at this point in the history
  • Loading branch information
jdygert-spok authored Aug 7, 2024
1 parent fc6834f commit e19030e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ciborium-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl<W: Write + ?Sized> Write for &mut W {

/// An error indicating there are no more bytes to read
#[cfg(not(feature = "std"))]
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct EndOfFile(());

#[cfg(not(feature = "std"))]
Expand All @@ -127,7 +127,7 @@ impl Read for &[u8] {

/// An error indicating that the output cannot accept more bytes
#[cfg(not(feature = "std"))]
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct OutOfSpace(());

#[cfg(not(feature = "std"))]
Expand Down
2 changes: 1 addition & 1 deletion ciborium-ll/src/dec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use super::*;
use ciborium_io::Read;

/// An error that occurred while decoding
#[derive(Debug)]
#[derive(Clone, Debug)]
pub enum Error<T> {
/// An error occurred while reading bytes
///
Expand Down
2 changes: 1 addition & 1 deletion ciborium/src/de/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use core::fmt::{Debug, Display, Formatter, Result};
use serde::de::{Error as DeError, StdError};

/// An error occurred during deserialization
#[derive(Debug)]
#[derive(Clone, Debug)]
pub enum Error<T> {
/// An error occurred while reading bytes
///
Expand Down
2 changes: 1 addition & 1 deletion ciborium/src/ser/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use core::fmt::{Debug, Display, Formatter, Result};
use serde::ser::{Error as SerError, StdError};

/// An error occurred during serialization
#[derive(Debug)]
#[derive(Clone, Debug)]
pub enum Error<T> {
/// An error occurred while writing bytes
///
Expand Down
2 changes: 1 addition & 1 deletion ciborium/src/value/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use alloc::string::{String, ToString};

/// The error when serializing to/from a `Value`
#[derive(Debug)]
#[derive(Clone, Debug)]
pub enum Error {
/// A custom error string produced by serde
Custom(String),
Expand Down

0 comments on commit e19030e

Please sign in to comment.