about summary refs log tree commit diff
path: root/tvix/store/src/proto.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-01-06T15·27+0100
committerflokli <flokli@flokli.de>2023-01-06T15·39+0000
commitc89af03a030b8447954d17972ce6f64fb6d42f57 (patch)
tree252edef441896ec9ce3111c663d5d576e76e3379 /tvix/store/src/proto.rs
parent999afd4be27619657a10d3031f289f627bb029b1 (diff)
refactor(tvix/store): rename NixPath to StorePath r/5613
As discussed in #tvl, this is a more common term for it.

Change-Id: I9b904222b8c076f82192c9b7f0b42be171614ab7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7776
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/proto.rs')
-rw-r--r--tvix/store/src/proto.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/tvix/store/src/proto.rs b/tvix/store/src/proto.rs
index f2af69ab0dbb..f2dfe1a86d1c 100644
--- a/tvix/store/src/proto.rs
+++ b/tvix/store/src/proto.rs
@@ -5,7 +5,7 @@ use thiserror::Error;
 
 use prost::Message;
 
-use crate::nixpath::{NixPath, ParseNixPathError};
+use crate::store_path::{ParseStorePathError, StorePath};
 
 tonic::include_proto!("tvix.store.v1");
 
@@ -41,7 +41,7 @@ pub enum ValidatePathInfoError {
 
     /// Invalid node name encountered.
     #[error("{0} is an invalid node name: {1}")]
-    InvalidNodeName(String, ParseNixPathError),
+    InvalidNodeName(String, ParseStorePathError),
 
     /// The digest the (root) node refers to has invalid length.
     #[error("Invalid Digest length: {0}")]
@@ -76,13 +76,13 @@ fn validate_digest<E>(digest: &Vec<u8>, err: fn(usize) -> E) -> Result<(), E> {
 
 /// Parses a root node name.
 ///
-/// On success, this returns the parsed [NixPath].
+/// On success, this returns the parsed [StorePath].
 /// On error, it returns an error generated from the supplied constructor.
 fn parse_node_name_root<E>(
     name: &str,
-    err: fn(String, ParseNixPathError) -> E,
-) -> Result<NixPath, E> {
-    match NixPath::from_string(name) {
+    err: fn(String, ParseStorePathError) -> E,
+) -> Result<StorePath, E> {
+    match StorePath::from_string(name) {
         Ok(np) => Ok(np),
         Err(e) => Err(err(name.to_string(), e)),
     }
@@ -90,9 +90,9 @@ fn parse_node_name_root<E>(
 
 impl PathInfo {
     /// validate performs some checks on the PathInfo struct,
-    /// Returning either a [NixPath] of the root node, or a
+    /// Returning either a [StorePath] of the root node, or a
     /// [ValidatePathInfoError].
-    pub fn validate(&self) -> Result<NixPath, ValidatePathInfoError> {
+    pub fn validate(&self) -> Result<StorePath, ValidatePathInfoError> {
         // If there is a narinfo field populated, ensure the number of references there
         // matches PathInfo.references count.
         if let Some(narinfo) = &self.narinfo {
@@ -106,7 +106,7 @@ impl PathInfo {
         // FUTUREWORK: parse references in reference_names. ensure they start
         // with storeDir, and use the same digest as in self.references.
 
-        // Ensure there is a (root) node present, and it properly parses to a NixPath.
+        // Ensure there is a (root) node present, and it properly parses to a [StorePath].
         let root_nix_path = match &self.node {
             None => {
                 return Err(ValidatePathInfoError::NoNodePresent());