mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-22 16:38:11 -07:00
computer: part 2
This commit is contained in:
@@ -19,6 +19,7 @@ where
|
||||
+ Sync,
|
||||
{
|
||||
fn to_usize(self) -> Result<usize>;
|
||||
fn to_string<'a>() -> &'a str;
|
||||
}
|
||||
impl<I> StoredIndex for I
|
||||
where
|
||||
@@ -40,4 +41,9 @@ where
|
||||
fn to_usize(self) -> Result<usize> {
|
||||
self.try_into().map_err(|_| Error::FailedKeyTryIntoUsize)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn to_string<'a>() -> &'a str {
|
||||
std::any::type_name::<I>()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user