Skip to content

Commit ac0906f

Browse files
committed
Apply latest changes
1 parent 9caa065 commit ac0906f

File tree

2 files changed

+8
-94
lines changed

2 files changed

+8
-94
lines changed

README.md

+4-47
Original file line numberDiff line numberDiff line change
@@ -34,55 +34,12 @@ struct Example<T>(PhantomData<T>);
3434
```
3535

3636
Multiple `derive_where` attributes can be added to an item, but only the
37-
first one should use any path qualifications. Otherwise helper attributes
38-
won't be applied to any but the first `derive_where` attribute on the item.
37+
first one must use any path qualifications.
3938

4039
```rust
41-
#[derive_where::derive_where(Clone, Debug; T)]
42-
#[derive_where(PartialEq)]
43-
struct Example1<T, U> {
44-
a: u8,
45-
#[derive_where(skip)]
46-
b: u8,
47-
ph: PhantomData<(T, U)>,
48-
}
49-
50-
let var1 = Example1 {
51-
a: 42,
52-
b: 42,
53-
ph: PhantomData::<((), ())>,
54-
};
55-
let var2 = Example1 {
56-
a: 42,
57-
b: 0,
58-
ph: PhantomData::<((), ())>,
59-
};
60-
61-
// Field `b` is not compared, as expected.
62-
assert_eq!(var1, var2);
63-
64-
#[derive_where::derive_where(Clone, Debug; T)]
65-
#[derive_where::derive_where(PartialEq)]
66-
struct Example2<T, U> {
67-
a: u8,
68-
#[derive_where(skip)]
69-
b: u8,
70-
ph: PhantomData<(T, U)>,
71-
}
72-
73-
let var1 = Example2 {
74-
a: 42,
75-
b: 42,
76-
ph: PhantomData::<((), ())>,
77-
};
78-
let var2 = Example2 {
79-
a: 42,
80-
b: 0,
81-
ph: PhantomData::<((), ())>,
82-
};
83-
84-
// Field `b` is compared!
85-
assert_ne!(var1, var2);
40+
#[derive_where::derive_where(Clone)]
41+
#[derive_where(Debug)]
42+
struct Example1<T>(PhantomData<T>);
8643
```
8744

8845
In addition, the following convenience options are available:

src/lib.rs

+4-47
Original file line numberDiff line numberDiff line change
@@ -26,56 +26,13 @@
2626
//! `T: Trait` bound to the corresponding trait.
2727
//!
2828
//! Multiple `derive_where` attributes can be added to an item, but only the
29-
//! first one should use any path qualifications. Otherwise helper attributes
30-
//! won't be applied to any but the first `derive_where` attribute on the item.
29+
//! first one must use any path qualifications.
3130
//!
3231
//! ```
3332
//! # use std::marker::PhantomData;
34-
//! #[derive_where::derive_where(Clone, Debug; T)]
35-
//! #[derive_where(PartialEq)]
36-
//! struct Example1<T, U> {
37-
//! a: u8,
38-
//! #[derive_where(skip)]
39-
//! b: u8,
40-
//! ph: PhantomData<(T, U)>,
41-
//! }
42-
//!
43-
//! let var1 = Example1 {
44-
//! a: 42,
45-
//! b: 42,
46-
//! ph: PhantomData::<((), ())>,
47-
//! };
48-
//! let var2 = Example1 {
49-
//! a: 42,
50-
//! b: 0,
51-
//! ph: PhantomData::<((), ())>,
52-
//! };
53-
//!
54-
//! // Field `b` is not compared, as expected.
55-
//! assert_eq!(var1, var2);
56-
//!
57-
//! #[derive_where::derive_where(Clone, Debug; T)]
58-
//! #[derive_where::derive_where(PartialEq)]
59-
//! struct Example2<T, U> {
60-
//! a: u8,
61-
//! #[derive_where(skip)]
62-
//! b: u8,
63-
//! ph: PhantomData<(T, U)>,
64-
//! }
65-
//!
66-
//! let var1 = Example2 {
67-
//! a: 42,
68-
//! b: 42,
69-
//! ph: PhantomData::<((), ())>,
70-
//! };
71-
//! let var2 = Example2 {
72-
//! a: 42,
73-
//! b: 0,
74-
//! ph: PhantomData::<((), ())>,
75-
//! };
76-
//!
77-
//! // Field `b` is compared!
78-
//! assert_ne!(var1, var2);
33+
//! #[derive_where::derive_where(Clone)]
34+
//! #[derive_where(Debug)]
35+
//! struct Example1<T>(PhantomData<T>);
7936
//! ```
8037
//!
8138
//! In addition, the following convenience options are available:

0 commit comments

Comments
 (0)