Skip to content
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

Make ObjectStoreScheme public #5912

Merged
merged 3 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion object_store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ pub mod integration;

pub use attributes::*;

pub use parse::{parse_url, parse_url_opts};
pub use parse::{parse_url, parse_url_opts, ObjectStoreScheme};
pub use payload::*;
pub use upload::*;
pub use util::{coalesce_ranges, collect_bytes, GetRange, OBJECT_STORE_COALESCE_DEFAULT};
Expand Down
4 changes: 2 additions & 2 deletions object_store/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl From<Error> for super::Error {

/// Recognises various URL formats, identifying the relevant [`ObjectStore`]
#[derive(Debug, Eq, PartialEq)]
enum ObjectStoreScheme {
pub enum ObjectStoreScheme {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe slap a #[non_exhaustive] on this, so that new variants can be added after a potential 1.0 release

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in b9ca112

/// Url corresponding to [`LocalFileSystem`]
Local,
/// Url corresponding to [`InMemory`]
Expand All @@ -62,7 +62,7 @@ impl ObjectStoreScheme {
/// Create an [`ObjectStoreScheme`] from the provided [`Url`]
///
/// Returns the [`ObjectStoreScheme`] and the remaining [`Path`]
fn parse(url: &Url) -> Result<(Self, Path), Error> {
pub fn parse(url: &Url) -> Result<(Self, Path), Error> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to change this to return super::Error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in b9ca112 (by making error public not by returning super::Error)

let strip_bucket = || Some(url.path().strip_prefix('/')?.split_once('/')?.1);

let (scheme, path) = match (url.scheme(), url.host_str()) {
Expand Down
Loading