From 9cb3daee20ad68f6d8351f116d50da789d3f1daf Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 14 Jan 2023 01:45:06 +0300 Subject: refactor(tvix/cli): reference scanner owns all the strings 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 Tested-by: BuildkiteCI --- tvix/cli/src/known_paths.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/cli/src/known_paths.rs') 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) } } -- cgit 1.4.1