From 6af8d1cd01294e5e83cf10395db0df1ab5e8fddd Mon Sep 17 00:00:00 2001 From: Robert Pack Date: Tue, 10 May 2022 22:22:54 +0200 Subject: [PATCH 1/2] default to root for empty path in azure store --- rust/src/storage/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rust/src/storage/mod.rs b/rust/src/storage/mod.rs index e2a5788b3b..ce48d1b4a6 100644 --- a/rust/src/storage/mod.rs +++ b/rust/src/storage/mod.rs @@ -253,9 +253,7 @@ pub fn parse_uri<'a>(path: &'a str) -> Result, UriError> { }; let path = match path_parts.next() { Some(x) => x, - None => { - return Err(UriError::MissingObjectPath); - } + None => "/", }; Ok(Uri::AdlsGen2Object(azure::AdlsGen2Object { account_name, file_system, path })) From b0a43815456d1d2207d9ad8c86cdd2edb5b7912b Mon Sep 17 00:00:00 2001 From: Robert Pack Date: Tue, 10 May 2022 22:48:17 +0200 Subject: [PATCH 2/2] clippy --- rust/src/storage/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rust/src/storage/mod.rs b/rust/src/storage/mod.rs index ce48d1b4a6..2eb224fb6d 100644 --- a/rust/src/storage/mod.rs +++ b/rust/src/storage/mod.rs @@ -251,10 +251,7 @@ pub fn parse_uri<'a>(path: &'a str) -> Result, UriError> { return Err(UriError::MissingObjectFileSystem); } }; - let path = match path_parts.next() { - Some(x) => x, - None => "/", - }; + let path = path_parts.next().unwrap_or("/"); Ok(Uri::AdlsGen2Object(azure::AdlsGen2Object { account_name, file_system, path })) } else {