wipfix: errors in the rest of the crates

feat/type-attributes
Tomáš Mládek 2023-06-28 10:23:37 +02:00
parent 774d24d6cd
commit 853aa8087b
4 changed files with 8 additions and 9 deletions

2
Cargo.lock generated
View File

@ -3297,7 +3297,7 @@ dependencies = [
"tree_magic_mini",
"upend-base",
"url",
"uuid 0.8.2",
"uuid 1.4.0",
"walkdir",
]

View File

@ -333,9 +333,7 @@ impl TryInto<Address> for InAddress {
fn try_into(self) -> Result<Address, Self::Error> {
Ok(match self {
InAddress::Address(address) => address.parse()?,
InAddress::Components { t, c } => {
Address::from_components(AddressComponents { t: &t, c })?
}
InAddress::Components { t, c } => Address::from_components(AddressComponents { t, c })?,
})
}
}
@ -389,10 +387,10 @@ pub async fn put_object(
timestamp: chrono::Utc::now().naive_utc(),
})
} else {
Entry::try_from(&InvariantEntry {
Ok(Entry::try_from(&InvariantEntry {
attribute: in_entry.attribute,
value: in_entry.value,
})
})?)
}
};

View File

@ -44,7 +44,7 @@ multihash = { version = "*", default-features = false, features = [
"sha2",
"identity",
] }
uuid = { version = "0.8", features = ["v4"] }
uuid = { version = "1.4", features = ["v4"] }
url = { version = "2", features = ["serde"] }
filebuffer = "0.4.0"

View File

@ -40,6 +40,7 @@ use std::time::Duration;
use tracing::{debug, error, trace, warn};
use upend_base::addressing::{Address, Addressable};
use upend_base::entry::{Entry, EntryValue, ImmutableEntry};
use upend_base::error::UpEndError;
use upend_base::hash::Digest;
use upend_base::lang::Query;
@ -262,7 +263,7 @@ impl UpEndConnection {
.map(|e| e.address())
.filter_map(Result::ok)
.map(|addr| addr.encode())
.collect::<Result<Vec<Vec<u8>>>>()?,
.collect::<Result<Vec<Vec<u8>>, UpEndError>>()?,
),
)
.load::<models::Entry>(&conn)?;
@ -311,7 +312,7 @@ impl UpEndConnection {
debug!("Inserting: {}", entry);
let db_entry = models::Entry::try_from(&entry)?;
self.insert_model_entry(db_entry)?;
entry.address()
Ok(entry.address()?)
}
pub fn insert_entry_immutable(&self, entry: Entry) -> Result<Address> {