From 5d8f9d21cd4ae042a43714a85b3f04d909d3c6c6 Mon Sep 17 00:00:00 2001 From: Konstantin Stepanov Date: Sun, 28 Feb 2021 11:29:23 +0300 Subject: [PATCH] reformat comments --- src/model/idtypes.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/model/idtypes.rs b/src/model/idtypes.rs index 870e2029..12221706 100644 --- a/src/model/idtypes.rs +++ b/src/model/idtypes.rs @@ -86,15 +86,15 @@ pub struct IdBuf { impl AsRef> for IdBuf { fn as_ref(&self) -> &Id { - // Safe, b/c of the same T between types, IdBuf can't be constructed from invalid id, and Id is just a wrapped str with ZST type tag + // Safe, b/c of the same T between types, IdBuf can't be constructed + // from invalid id, and Id is just a wrapped str with ZST type tag unsafe { &*(&*self.id as *const str as *const Id) } } } impl Borrow> for IdBuf { fn borrow(&self) -> &Id { - // Safe, b/c of the same T between types, IdBuf can't be constructed from invalid id, and Id is just a wrapped str with ZST type tag - unsafe { &*(&*self.id as *const str as *const Id) } + self.as_ref() } }