Skip to content

Commit

Permalink
Relax the K: JsonFrom<J> bound from AsJson.
Browse files Browse the repository at this point in the history
Fix #33.
  • Loading branch information
Timothée Haudebourg committed Jan 24, 2022
1 parent 7df142c commit 2ccb23e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.6.1]
- Relax the `K: JsonFrom<J>` bound into `K: Json` from the `AsJson` trait definition. Fixes #33.

## [0.6.0]
### Changed
- Associate a unique identifier to each loaded document through the `Loader` trait.
- Locate errors using its source (a `loader::Id`) and its metadata.
Expand All @@ -17,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `Loc` type to locate errors and warnings.
- `loader::Id` type to identify source files.
- `Loader::id`, `Loader::iri`.
- Compaction API.

## [0.5.0] - 2021-11-04
### Changed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "json-ld"
version = "0.6.0"
version = "0.6.1"
authors = ["Timothée Haudebourg <author@haudebourg.net>"]
edition = "2018"
categories = ["web-programming", "database", "data-structures"]
Expand Down
2 changes: 1 addition & 1 deletion src/util/json/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ where <Self as Json>::Number: From<<J as Json>::Number>;

/// Type composed of `J` JSON values that can be converted
/// into a `K` JSON value.
pub trait AsJson<J: JsonClone, K: JsonFrom<J>> {
pub trait AsJson<J: JsonClone, K: Json> {
/// Converts this value into a `K` JSON value using the given
/// `meta` function to convert `J::MetaData` into `K::MetaData`.
fn as_json_with(&self, meta: impl Clone + Fn(Option<&J::MetaData>) -> K::MetaData) -> K;
Expand Down

0 comments on commit 2ccb23e

Please sign in to comment.