diff options
Diffstat (limited to 'tvix/derivation')
-rw-r--r-- | tvix/derivation/src/derivation.rs | 6 | ||||
-rw-r--r-- | tvix/derivation/src/errors.rs | 4 | ||||
-rw-r--r-- | tvix/derivation/src/output.rs | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/tvix/derivation/src/derivation.rs b/tvix/derivation/src/derivation.rs index 45fcfb6b9f4b..390024da33ee 100644 --- a/tvix/derivation/src/derivation.rs +++ b/tvix/derivation/src/derivation.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; use std::collections::BTreeSet; use std::{collections::BTreeMap, fmt, fmt::Write}; -use tvix_store::nixbase32::NIXBASE32; +use tvix_store::nixbase32; use tvix_store::store_path::{StorePath, STORE_DIR}; #[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] @@ -64,9 +64,9 @@ fn build_store_path( }; let compressed = compress_hash(&digest, 20); if is_derivation { - StorePath::from_string(format!("{}-{}.drv", NIXBASE32.encode(&compressed), name).as_str()) + StorePath::from_string(format!("{}-{}.drv", nixbase32::encode(&compressed), name).as_str()) } else { - StorePath::from_string(format!("{}-{}", NIXBASE32.encode(&compressed), name,).as_str()) + StorePath::from_string(format!("{}-{}", nixbase32::encode(&compressed), name,).as_str()) } .map_err(|_e| DerivationError::InvalidOutputName(name.to_string())) // Constructing the StorePath can only fail if the passed output name was diff --git a/tvix/derivation/src/errors.rs b/tvix/derivation/src/errors.rs index a1c49650edef..cf7e65697e80 100644 --- a/tvix/derivation/src/errors.rs +++ b/tvix/derivation/src/errors.rs @@ -1,5 +1,5 @@ use thiserror::Error; -use tvix_store::store_path::ParseStorePathError; +use tvix_store::{nixbase32::Nixbase32DecodeError, store_path::ParseStorePathError}; /// Errors that can occur during the validation of Derivation structs. #[derive(Debug, Error, PartialEq)] @@ -48,7 +48,7 @@ pub enum OutputError { #[error("Invalid ouput path {0}: {1}")] InvalidOutputPath(String, ParseStorePathError), #[error("Invalid hash encoding: {0}")] - InvalidHashEncoding(String, data_encoding::DecodeError), + InvalidHashEncoding(String, Nixbase32DecodeError), #[error("Invalid hash algo: {0}")] InvalidHashAlgo(String), #[error("Invalid Digest size {0} for algo {1}")] diff --git a/tvix/derivation/src/output.rs b/tvix/derivation/src/output.rs index 36a480d5a0d7..ac5a7bcb6c2d 100644 --- a/tvix/derivation/src/output.rs +++ b/tvix/derivation/src/output.rs @@ -1,5 +1,5 @@ use serde::{Deserialize, Serialize}; -use tvix_store::{nixbase32::NIXBASE32, store_path::StorePath}; +use tvix_store::{nixbase32, store_path::StorePath}; use crate::OutputError; @@ -27,7 +27,7 @@ impl Output { pub fn validate(&self, validate_output_paths: bool) -> Result<(), OutputError> { if let Some(hash) = &self.hash { // try to decode digest - let result = NIXBASE32.decode(&hash.digest.as_bytes()); + let result = nixbase32::decode(&hash.digest.as_bytes()); match result { Err(e) => return Err(OutputError::InvalidHashEncoding(hash.digest.clone(), e)), Ok(digest) => { |