global: crates cleanup

This commit is contained in:
nym21
2025-02-24 00:25:58 +01:00
parent 8acbcc548c
commit 2f93fd7c36
21 changed files with 138 additions and 67 deletions

View File

@@ -9,6 +9,7 @@ license = { workspace = true }
brk_fetcher = { workspace = true }
brk_indexer = { workspace = true }
brk_parser = { workspace = true }
byteview = { workspace = true }
color-eyre = { workspace = true }
derive_deref = { workspace = true }
fjall = { workspace = true }

View File

@@ -1,5 +1,5 @@
use brk_indexer::{Addressindex, Txoutindex};
use fjall::Slice;
use byteview::ByteView;
use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout};
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Immutable, IntoBytes, KnownLayout, FromBytes)]
@@ -9,13 +9,13 @@ pub struct AddressindexTxoutindex {
txoutindex: Txoutindex,
}
impl TryFrom<Slice> for AddressindexTxoutindex {
impl TryFrom<ByteView> for AddressindexTxoutindex {
type Error = storable_vec::Error;
fn try_from(value: Slice) -> Result<Self, Self::Error> {
fn try_from(value: ByteView) -> Result<Self, Self::Error> {
Ok(Self::read_from_bytes(&value)?)
}
}
impl From<AddressindexTxoutindex> for Slice {
impl From<AddressindexTxoutindex> for ByteView {
fn from(value: AddressindexTxoutindex) -> Self {
Self::new(value.as_bytes())
}

View File

@@ -1,12 +1,12 @@
use fjall::Slice;
use byteview::ByteView;
pub struct Unit();
impl From<Slice> for Unit {
fn from(_: Slice) -> Self {
impl From<ByteView> for Unit {
fn from(_: ByteView) -> Self {
Self()
}
}
impl From<Unit> for Slice {
impl From<Unit> for ByteView {
fn from(_: Unit) -> Self {
Self::new(&[])
}