Skip to content

Commit cc0f832

Browse files
committed
rebase + prepare release
Created using spr 1.3.6-beta.1
2 parents 58da546 + 32fb346 commit cc0f832

File tree

3 files changed

+29
-22
lines changed

3 files changed

+29
-22
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [0.1.1] - 2025-02-10
4+
5+
### Added
6+
7+
- Add `Leaf::is_unchanged` and `Leaf::is_modified` when the stored type is `Eq`.
8+
- Add `BTreeMapDiff::is_unchanged`, `BTreeMapDiff::is_modified`, `BTreeMapDiff::get_unchanged`, `BTreeMapDiff::get_modified`, and similar methods for `HashMapDiff` when map values are `Eq`.
9+
310
## [0.1.0] - 2025-02-10
411

512
Initial release with support for:

daft-derive/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! For more information about daft, see [its documentation](https://docs.rs/daft).
44
// Setting html_root_url allows daft's readme to have links to daft-derive. This
55
// line is updated by cargo-release.
6-
#![doc(html_root_url = "https://docs.rs/daft-derive/0.1.0")]
6+
#![doc(html_root_url = "https://docs.rs/daft-derive/0.1.1")]
77
mod internals;
88

99
use syn::parse_macro_input;

daft/README.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<!-- cargo-sync-rdme rustdoc [[ -->
1111
Daft is a library to perform semantic diffs of Rust data structures.
1212

13-
Daft consists of a trait called [`Diffable`](https://docs.rs/daft/0.1.0/daft/diffable/trait.Diffable.html), along with [a derive
14-
macro](https://docs.rs/daft-derive/0.1.0/daft_derive/derive.Diffable.html) by the same name. This trait represents the
13+
Daft consists of a trait called [`Diffable`](https://docs.rs/daft/0.1.1/daft/diffable/trait.Diffable.html), along with [a derive
14+
macro](https://docs.rs/daft-derive/0.1.1/daft_derive/derive.Diffable.html) by the same name. This trait represents the
1515
notion of a type for which two members can be simultaneously compared.
1616

1717
## Features
@@ -62,10 +62,10 @@ reversed.
6262

6363
Currently, daft comes with a few kinds of diff types:
6464

65-
#### [`Leaf`](https://docs.rs/daft/0.1.0/daft/leaf/struct.Leaf.html) instances
65+
#### [`Leaf`](https://docs.rs/daft/0.1.1/daft/leaf/struct.Leaf.html) instances
6666

67-
A [`Leaf`](https://docs.rs/daft/0.1.0/daft/leaf/struct.Leaf.html) represents a logical *leaf node* or *base case* in a diff, i.e. a
68-
point at which diffing stops. [`Leaf`](https://docs.rs/daft/0.1.0/daft/leaf/struct.Leaf.html) instances are used for:
67+
A [`Leaf`](https://docs.rs/daft/0.1.1/daft/leaf/struct.Leaf.html) represents a logical *leaf node* or *base case* in a diff, i.e. a
68+
point at which diffing stops. [`Leaf`](https://docs.rs/daft/0.1.1/daft/leaf/struct.Leaf.html) instances are used for:
6969

7070
* *Scalar* or *primitive types* like `i32`, `String`, `bool`, etc.
7171
* *Enums*, since diffing across variants is usually not meaningful.
@@ -125,8 +125,8 @@ assert_eq!(diff.after, &after);
125125

126126
#### Map diffs
127127

128-
For [`BTreeMap`] and [`HashMap`], daft has corresponding [`BTreeMapDiff`](https://docs.rs/daft/0.1.0/daft/alloc_impls/struct.BTreeMapDiff.html)
129-
and [`HashMapDiff`](https://docs.rs/daft/0.1.0/daft/std_impls/struct.HashMapDiff.html) types. These types have fields for *common*, *added*,
128+
For [`BTreeMap`] and [`HashMap`], daft has corresponding [`BTreeMapDiff`](https://docs.rs/daft/0.1.1/daft/alloc_impls/struct.BTreeMapDiff.html)
129+
and [`HashMapDiff`](https://docs.rs/daft/0.1.1/daft/std_impls/struct.HashMapDiff.html) types. These types have fields for *common*, *added*,
130130
and *removed* entries.
131131

132132
Map diffs are performed eagerly for keys, but values are stored as leaf
@@ -181,8 +181,8 @@ assert_eq!(
181181

182182
#### Set diffs
183183

184-
For [`BTreeSet`] and [`HashSet`], daft has corresponding [`BTreeSetDiff`](https://docs.rs/daft/0.1.0/daft/alloc_impls/struct.BTreeSetDiff.html)
185-
and [`HashSetDiff`](https://docs.rs/daft/0.1.0/daft/std_impls/struct.HashSetDiff.html) types. These types have fields for *common*, *added*,
184+
For [`BTreeSet`] and [`HashSet`], daft has corresponding [`BTreeSetDiff`](https://docs.rs/daft/0.1.1/daft/alloc_impls/struct.BTreeSetDiff.html)
185+
and [`HashSetDiff`](https://docs.rs/daft/0.1.1/daft/std_impls/struct.HashSetDiff.html) types. These types have fields for *common*, *added*,
186186
and *removed* entries.
187187

188188
Set diffs are performed eagerly.
@@ -204,7 +204,7 @@ assert_eq!(diff.removed, [&0, &1, &2].into_iter().collect());
204204

205205
#### Tuple diffs
206206

207-
For a tuple like `(A, B, C)`, the [`Diffable`](https://docs.rs/daft/0.1.0/daft/diffable/trait.Diffable.html) implementation is recursive:
207+
For a tuple like `(A, B, C)`, the [`Diffable`](https://docs.rs/daft/0.1.1/daft/diffable/trait.Diffable.html) implementation is recursive:
208208
the diff resolves to `(A::Diff, B::Diff, C::Diff)`.
209209

210210
##### Example
@@ -233,24 +233,24 @@ assert_eq!(
233233

234234
#### Struct diffs
235235

236-
For structs, the [`Diffable`](https://docs.rs/daft-derive/0.1.0/daft_derive/derive.Diffable.html) derive macro generates
236+
For structs, the [`Diffable`](https://docs.rs/daft-derive/0.1.1/daft_derive/derive.Diffable.html) derive macro generates
237237
a diff type with a field corresponding to each field type. Each field must
238-
implement [`Diffable`](https://docs.rs/daft/0.1.0/daft/diffable/trait.Diffable.html).
238+
implement [`Diffable`](https://docs.rs/daft/0.1.1/daft/diffable/trait.Diffable.html).
239239

240240
A struct `Foo` gets a corresponding `FooDiff` struct, which has fields
241241
corresponding to each field in `Foo`.
242242

243243
##### Struct options
244244

245-
* `#[daft(leaf)]`: if a **struct** is annotated with this, the [`Diffable`](https://docs.rs/daft/0.1.0/daft/diffable/trait.Diffable.html)
246-
implementation for the struct will be a [`Leaf`](https://docs.rs/daft/0.1.0/daft/leaf/struct.Leaf.html) instead of a recursive
245+
* `#[daft(leaf)]`: if a **struct** is annotated with this, the [`Diffable`](https://docs.rs/daft/0.1.1/daft/diffable/trait.Diffable.html)
246+
implementation for the struct will be a [`Leaf`](https://docs.rs/daft/0.1.1/daft/leaf/struct.Leaf.html) instead of a recursive
247247
diff.
248248

249249
##### Field options
250250

251251
* `#[daft(leaf)]`: if a **struct field** is annotated with this, the generated
252-
struct’s corresponding field will be a [`Leaf`](https://docs.rs/daft/0.1.0/daft/leaf/struct.Leaf.html), regardless of the field’s
253-
`Diff` type (or even whether it implements [`Diffable`](https://docs.rs/daft/0.1.0/daft/diffable/trait.Diffable.html) at all).
252+
struct’s corresponding field will be a [`Leaf`](https://docs.rs/daft/0.1.1/daft/leaf/struct.Leaf.html), regardless of the field’s
253+
`Diff` type (or even whether it implements [`Diffable`](https://docs.rs/daft/0.1.1/daft/diffable/trait.Diffable.html) at all).
254254
* `#[daft(ignore)]`: the generated struct’s corresponding field is not included
255255
in the diff.
256256

@@ -349,7 +349,7 @@ assert_eq!(diff.plain, Leaf { before: &PlainStruct(1), after: &PlainStruct(2) })
349349

350350
#### Custom diff types
351351

352-
The [`Diffable`](https://docs.rs/daft/0.1.0/daft/diffable/trait.Diffable.html) trait can also be implemented manually for custom behavior.
352+
The [`Diffable`](https://docs.rs/daft/0.1.1/daft/diffable/trait.Diffable.html) trait can also be implemented manually for custom behavior.
353353

354354
In general, most custom implementations will likely use one of the built-in
355355
diff types directly.
@@ -378,7 +378,7 @@ impl Diffable for Identifier {
378378

379379
### Type and lifetime parameters
380380

381-
If a type parameter is specified, the [`Diffable`](https://docs.rs/daft-derive/0.1.0/daft_derive/derive.Diffable.html) derive
381+
If a type parameter is specified, the [`Diffable`](https://docs.rs/daft-derive/0.1.1/daft_derive/derive.Diffable.html) derive
382382
macro for structs normally requires that the type parameter implement
383383
`Diffable`. This is not required if the field is annotated with
384384
`#[daft(leaf)]`.
@@ -443,9 +443,9 @@ this crate and a great alternative. Daft diverges from diffus in a few ways:
443443
In practice, we’ve found that diffing enums across different variants is less
444444
useful than it first appears.
445445

446-
* Daft has the notion of a [`Leaf`](https://docs.rs/daft/0.1.0/daft/leaf/struct.Leaf.html) type, which represents an atomic unit.
447-
(For example, the [`Diffable`](https://docs.rs/daft/0.1.0/daft/diffable/trait.Diffable.html) implementation for `i32` is a [`Leaf`](https://docs.rs/daft/0.1.0/daft/leaf/struct.Leaf.html).)
448-
[`Leaf`](https://docs.rs/daft/0.1.0/daft/leaf/struct.Leaf.html)s are also used for enums, as well as in any other place where lazy
446+
* Daft has the notion of a [`Leaf`](https://docs.rs/daft/0.1.1/daft/leaf/struct.Leaf.html) type, which represents an atomic unit.
447+
(For example, the [`Diffable`](https://docs.rs/daft/0.1.1/daft/diffable/trait.Diffable.html) implementation for `i32` is a [`Leaf`](https://docs.rs/daft/0.1.1/daft/leaf/struct.Leaf.html).)
448+
[`Leaf`](https://docs.rs/daft/0.1.1/daft/leaf/struct.Leaf.html)s are also used for enums, as well as in any other place where lazy
449449
diffing is desired.
450450

451451
* Diffus has a `Same` trait, which is like `Eq` except it’s also implemented

0 commit comments

Comments
 (0)