Skip to content

Commit a09527b

Browse files
authored
rename cast to upcast (#87)
Per feedback, rename the method to make it clear that a typed UUID is being converted to one with looser semantics.
1 parent df08a52 commit a09527b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/newtype-uuid/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ impl<T: TypedUuidKind> TypedUuid<T> {
298298
self.uuid.get_version()
299299
}
300300

301-
/// Converts the UUID to one with a different kind.
301+
/// Converts the UUID to one with looser semantics.
302302
///
303303
/// By default, UUID kinds are considered independent, and conversions
304304
/// between them must happen via the [`GenericUuid`] interface. But in some
@@ -360,11 +360,11 @@ impl<T: TypedUuidKind> TypedUuid<T> {
360360
/// // Now you can convert between them:
361361
/// let git_uuid: TypedUuid<GitRepoKind> =
362362
/// TypedUuid::from_u128(0xe9245204_34ea_4ca7_a1c6_2e94fa49df61);
363-
/// let repo_uuid: TypedUuid<RepoKind> = git_uuid.cast();
363+
/// let repo_uuid: TypedUuid<RepoKind> = git_uuid.upcast();
364364
/// ```
365365
#[inline]
366366
#[must_use]
367-
pub const fn cast<U: TypedUuidKind>(self) -> TypedUuid<U>
367+
pub const fn upcast<U: TypedUuidKind>(self) -> TypedUuid<U>
368368
where
369369
T: Into<U>,
370370
{

0 commit comments

Comments
 (0)