Skip to content

Commit 6e89db2

Browse files
doc(typed-uuid): add footnotes about new_unchecked
1 parent 771e9b6 commit 6e89db2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

benzina/src/typed_uuid.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
/// generates code which implements many useful traits, including the ones needed to work with
55
/// [`diesel`].
66
///
7-
/// The generated structs do not expose any method or trait to create an arbitrary instance, in
7+
/// The generated structs do not expose any method or trait to create an arbitrary instance[^See note], in
88
/// order to provide the guarantee that the `UUID` is valid. However, it is possible to choose to
99
/// add traits and methods to customize the behavior.
10-
///
1110
#[cfg_attr(
1211
not(feature = "example-generated"),
1312
doc = "To see the documentation of a generated typed `UUID`, consider re-building the \
@@ -48,7 +47,7 @@
4847
/// }
4948
/// ```
5049
///
51-
/// Keep in mind that there is no way to construct an instance unless the instantiation is done
50+
/// Keep in mind that there is no way[^See note] to construct an instance unless the instantiation is done
5251
/// inside the module containing the new type or a submodule of it:
5352
///
5453
/// ```compile_fail,E0603
@@ -62,6 +61,9 @@
6261
/// let foo = inner::Foo(Uuid::default());
6362
/// // ^^^ private tuple struct constructor
6463
/// ```
64+
///
65+
/// [^See note]: There is no way in normal usage to construct an instance. The exception is with the
66+
/// `new_unchecked` method, which is intended for special cases, such as testing.
6567
#[macro_export]
6668
macro_rules! typed_uuid {
6769
(

0 commit comments

Comments
 (0)