Skip to content

Commit f970554

Browse files
committed
refactor: remove unused From impls
1 parent ef475cb commit f970554

File tree

1 file changed

+0
-30
lines changed
  • stackslib/src/chainstate/stacks/index

1 file changed

+0
-30
lines changed

stackslib/src/chainstate/stacks/index/mod.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,6 @@ impl From<u32> for MARFValue {
171171
}
172172
}
173173

174-
impl From<u64> for MARFValue {
175-
fn from(value: u64) -> MARFValue {
176-
let h = value.to_le_bytes();
177-
let mut d = [0u8; MARF_VALUE_ENCODED_SIZE as usize];
178-
if h.len() > MARF_VALUE_ENCODED_SIZE as usize {
179-
panic!("Cannot convert a u64 into a MARF Value.");
180-
}
181-
d.get_mut(..h.len())
182-
.expect("Cannot convert a u64 into a MARF Value")
183-
.copy_from_slice(&h);
184-
MARFValue(d)
185-
}
186-
}
187-
188174
impl<T: MarfTrieId> From<T> for MARFValue {
189175
fn from(bhh: T) -> MARFValue {
190176
let h = bhh.to_bytes();
@@ -215,22 +201,6 @@ impl From<MARFValue> for u32 {
215201
}
216202
}
217203

218-
impl From<MARFValue> for u64 {
219-
fn from(m: MARFValue) -> u64 {
220-
let h = m.0;
221-
let mut d = [0u8; 8];
222-
223-
d.copy_from_slice(&h[..8]);
224-
225-
for h_i in &h[8..] {
226-
if *h_i != 0 {
227-
panic!("Failed to convert MARF value into u64: data stored after 8th byte");
228-
}
229-
}
230-
u64::from_le_bytes(d)
231-
}
232-
}
233-
234204
impl MARFValue {
235205
/// Construct from a TRIEHASH_ENCODED_SIZE-length slice
236206
pub fn from_value_hash_bytes(h: &[u8; TRIEHASH_ENCODED_SIZE]) -> MARFValue {

0 commit comments

Comments
 (0)