Skip to content

1.0.0-alpha.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@KodrAus KodrAus released this 04 Aug 04:18
8f723d0

Key changes

  • Refactor the public API in preparation for a stable 1.0 release.
  • Remove the top-levl sval::Value and sval::Stream imports.
  • Move serde integration to a serde::v1 module.

Migrating from 0.5.x

sval::Stream and sval::Value

These types were removed from the top-level of the crate because they're just re-exports from the value and stream modules, and since those modules also define their own Stream and Value types it was confusing to have them appear at the top-level too.

Instead of writing:

use sval::{Value, value};
use sval::{Stream, stream};

you'll now write:

use sval::value::{self, Value};
use sval::stream::{self, Stream};

sval::Error

The Error type now implements the standard std::error::Error trait when it's available. Doing that has meant removing a blanket From<E: std::error::Error> impl. It's a bit unfortunate because now you'll need to map sval::Errors into fmt::Error or io::Error manually:

stream.any(&self.0).map_err(sval::Error::into_fmt_error)?;

sval::serde

The serde support has been moved into a nested v1 module so that a future major version of serde can be added to a v2 module.

Instead of writing:

sval::serde::to_serialize(v);

you'll now write:

sval::serde::v1::to_serialize(v);

Contributions