1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Macros used for implementing [`IntoOwned`].
//!
//! [`IntoOwned`]: crate::IntoOwned
/// Implements [`IntoOwned`] via identity.
///
/// For example:
///
/// ```
/// use ownership::impl_identity;
///
/// struct Identity;
///
/// impl_identity!(Identity);
/// ```
///
/// expands to:
///
/// ```
/// struct Identity;
///
/// impl ownership::IntoOwned for Identity {
/// type Owned = Self;
///
/// fn into_owned(self) -> Self::Owned {
/// self
/// }
/// }
/// ```
///
/// [`IntoOwned`]: crate::IntoOwned