ByteBaker commented on code in PR #3358: URL: https://github.com/apache/arrow-rs/pull/3358#discussion_r1051643953
########## object_store/src/client/mod.rs: ########## @@ -165,6 +188,31 @@ impl ClientOptions { self } + /// Get the mime type for the file in `path` to be uploaded + /// + /// Gets the file extension from `path`, and returns the + /// mime type if it was defined initially through + /// `ClientOptions::with_content_type_for_suffix` + /// + /// Otherwise returns the default mime type if it was defined + /// earlier through `ClientOptions::with_default_content_type` + pub fn get_content_type(&self, path: &Path) -> Option<&str> { + match path + .as_ref() + .rsplit_once('.') Review Comment: I felt it'd be best if I returned an `Option<&str>` from `filename()`, which gives more context if the path were to be empty. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org