-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage crate reorg and cleanup #194
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'm just unsure about the renaming of the submodules to have the _storage
suffix. I'd like to hear the reasoning for that. I see you're trying to avoid module inception, but can you point to an example of that in the current code?
@@ -1,5 +1,5 @@ | |||
use azure_core::prelude::*; | |||
use azure_storage::blob::prelude::*; | |||
use azure_storage::blob_storage::prelude::*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the reasoning behind adding the storage
suffix to all the submodules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've explained below, it's for the module inception: tight now there is a blob module inside the blob module. Now we have the blob module inside the blob_storage module (which I think makes sense)
@MindFlavor putting the the table model into a module called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍 awesome!
@@ -98,8 +98,8 @@ fn format<D: Display>(value: D) -> String { | |||
pub fn to_str_without_bom(bytes: &bytes::Bytes) -> Result<&str, std::str::Utf8Error> { | |||
let s = from_utf8(bytes)?; | |||
|
|||
Ok(if s.starts_with('\u{FEFF}') { | |||
&s[3..] | |||
Ok(if let Some(stripped) = s.strip_prefix('\u{FEFF}') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think the following is clearer:
s.strip_prefix('...').unwrap_or(s)
This is a seemly big PR but it's mostly code shuffling. With this PR I believe we are very close to release v0.1! 🥇
Purpose
blob_storage
,table_storage
, etc... to avoid module inception (see https://rust-lang.github.io/rust-clippy/master/index.html#module_inception).blob_storage
specific clients fromcore
to the appropriate module.azure_storage
without default features or combinations of features less than the default #177). Right now by default it compiles everything but you can, say, usetable_storage
without anything else.hyper
(to support target wasm & wasi too #37). 🍾ok_or_else
etc...). The only "significant" change is the switch fromInto
toFrom
. Now the crate is clippy-compliant. 🍾Cons
hyper
dependency I had to remove the ability to generate signed URIs. We will reenable it in a future PR.