File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ serde = ["dep:serde", "uuid?/serde"]
3636utoipa = [" dep:utoipa" ]
3737
3838example-generated = [" typed-uuid" ]
39+ test = [" typed-uuid" ]
3940
4041[lints ]
4142workspace = true
Original file line number Diff line number Diff line change 77/// 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+ ///
1011#[ cfg_attr(
1112 not( feature = "example-generated" ) ,
1213 doc = "To see the documentation of a generated typed `UUID`, consider re-building the \
6364/// ```
6465///
6566/// [^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.
67+ /// `new_unchecked` method, which is gated behind the `test` feature and intended for special cases
68+ /// (including testing).
6769#[ macro_export]
6870macro_rules! typed_uuid {
6971 (
@@ -92,6 +94,7 @@ macro_rules! typed_uuid {
9294 impl $name {
9395 /// Creates a new, unchecked typed Uuid
9496 #[ must_use]
97+ #[ cfg( feature = "test" ) ]
9598 pub fn new_unchecked( inner: :: uuid:: Uuid ) -> Self {
9699 Self ( inner)
97100 }
You can’t perform that action at this time.
0 commit comments