diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e63233..a325149 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: - stable - beta - nightly - - 1.58.0 # MSRV + - 1.81.0 # MSRV steps: - uses: actions/checkout@v2 diff --git a/Cargo.toml b/Cargo.toml index 7c31f18..f821be3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "cbor_event" version = "3.0.0" +edition = "2015" +rust-version = "1.81" authors = ["Nicolas Di Prima ", "Vincent Hanquez "] license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/src/de.rs b/src/de.rs index 8ca6694..04b288d 100644 --- a/src/de.rs +++ b/src/de.rs @@ -197,7 +197,6 @@ impl Deserialize for Option { /// or unsupported format; /// - `Error::IndefiniteLenUnsupported(t)`: the Indefinite length is not /// supported for the given [`Type`] `t`; -/// - `Error::IoError(io_error)`: error due relating to buffer management; /// /// # Panic /// diff --git a/src/error.rs b/src/error.rs index 1f0313b..ef828c1 100644 --- a/src/error.rs +++ b/src/error.rs @@ -94,3 +94,12 @@ impl fmt::Display for Error { } } } + +impl core::error::Error for Error { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { + match self { + Error::InvalidTextError(error) => Some(error), + _ => None, + } + } +} diff --git a/src/lib.rs b/src/lib.rs index 641b2bd..1bcd228 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,6 @@ //! [`Deserialize`]: ./de/trait.Deserialize.html //! [`Serializer`]: ./se/struct.Serializer.html //! [`Serialize`]: ./se/trait.Serialize.html -//! [`std::io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html //! [`Error`]: ./enum.Error.html //! [`Type`]: ./enum.Type.html //! @@ -43,9 +42,8 @@ //! ## Serialisation: [`Serializer`] //! //! To serialise your objects into CBOR we provide a simple object -//! [`Serializer`]. It is configurable with any [`std::io::Write`] -//! objects. [`Serializer`] is meant to be simple to use and to have -//! limited overhead. +//! [`Serializer`]. It is meant to be simple to use and to have limited +//! overhead. //! //! ``` //! use cbor_event::se::{Serializer}; diff --git a/src/se.rs b/src/se.rs index 6e510c1..45c4ae9 100644 --- a/src/se.rs +++ b/src/se.rs @@ -207,8 +207,7 @@ where // every _reserve_ calls. const DEFAULT_CAPACITY: usize = 512; -/// simple CBOR serializer into any -/// [`std::io::Write`](https://doc.rust-lang.org/std/io/trait.Write.html). +/// simple CBOR serializer into an owned byte buffer. /// #[derive(Debug)] pub struct Serializer {