about summary refs log tree commit diff
path: root/tvix/cli/src/known_paths.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-01-13T22·45+0300
committertazjin <tazjin@tvl.su>2023-01-17T10·31+0000
commit9cb3daee20ad68f6d8351f116d50da789d3f1daf (patch)
tree05ba37073fed16b91962a0efc06cb3c06550dd59 /tvix/cli/src/known_paths.rs
parent940251b87f9d73087e2f51411fff9eba84a7108e (diff)
refactor(tvix/cli): reference scanner owns all the strings r/5671
This gets very complex very quickly otherwise, as all the construction
paths for a reference scanner and all the access patterns for the
KnownPaths structure are not yet fully understood.

Change-Id: Ibadf1f18b476695f3c286fc6896ae557760edf63
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7827
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/cli/src/known_paths.rs')
-rw-r--r--tvix/cli/src/known_paths.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/cli/src/known_paths.rs b/tvix/cli/src/known_paths.rs
index 10191c967edc..63372c9caaa9 100644
--- a/tvix/cli/src/known_paths.rs
+++ b/tvix/cli/src/known_paths.rs
@@ -107,8 +107,8 @@ impl KnownPaths {
     }
 
     /// Create a reference scanner from the current set of known paths.
-    pub fn reference_scanner<'a>(&'a self) -> ReferenceScanner<'a> {
-        let candidates: Vec<&'a str> = self.paths.keys().map(|s| s.as_str()).collect();
+    pub fn reference_scanner(&self) -> ReferenceScanner {
+        let candidates = self.paths.keys().map(Clone::clone).collect();
         ReferenceScanner::new(candidates)
     }
 }