diff options
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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); } } |