Skip to content

Commit 9e0d63d

Browse files
committed
move into impl
1 parent 84328b2 commit 9e0d63d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ impl<T: ?Sized + Committable> Commitment<T> {
132132
pub fn into_bits(self) -> BitVec<u8, bitvec::order::Lsb0> {
133133
BitVec::try_from(self.0.to_vec()).unwrap()
134134
}
135+
136+
pub fn from_raw(bytes: [u8; 32]) -> Self {
137+
Self(bytes, PhantomData)
138+
}
135139
}
136140

137141
// clippy pacification: `non_canonical_clone_impl` aka `incorrect_clone_impl_on_copy_type`
@@ -153,10 +157,6 @@ impl<T: ?Sized + Committable> From<Commitment<T>> for [u8; 32] {
153157
}
154158
}
155159

156-
pub fn from_raw<T: ?Sized + Committable>(bytes: [u8; 32]) -> Commitment<T> {
157-
Commitment(bytes, PhantomData)
158-
}
159-
160160
impl<'a, T: ?Sized + Committable> Arbitrary<'a> for Commitment<T> {
161161
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
162162
Ok(Self(u.arbitrary()?, PhantomData))

0 commit comments

Comments
 (0)