From 94a148cdb6f7660518c75a3c20109bf64848f0f1 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 1 May 2023 08:59:38 -0400 Subject: refactor(cli): use CliMainWorker in standalone (#18880) Uses `CliMainWorker` in all the cli code. --- cli/args/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cli/args') diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 440403f62..4038fb099 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1202,6 +1202,11 @@ impl StorageKeyResolver { }) } + /// Creates a storage key resolver that will always resolve to being empty. + pub fn empty() -> Self { + Self(Some(None)) + } + /// Resolves the storage key to use based on the current flags, config, or main module. pub fn resolve_storage_key( &self, @@ -1397,5 +1402,9 @@ mod test { resolver.resolve_storage_key(&specifier), Some("value".to_string()) ); + + // test empty + let resolver = StorageKeyResolver::empty(); + assert_eq!(resolver.resolve_storage_key(&specifier), None); } } -- cgit v1.2.3