Skip to content

refactor: Passing OpXxxx instead of content_type, cache_control,... in functions #3064

@Xuanwo

Description

@Xuanwo

OpenDAL used to passing content_type, cache_control directly like the following:

pub fn azblob_put_blob_request(
    &self,
    path: &str,
    size: Option<u64>,
    content_type: Option<&str>,
    cache_control: Option<&str>,
    body: AsyncBody,
) -> Result<Request<AsyncBody>> {}

It's not good and hard to maintain, sometimes clippy will raising warning for our code. So it's time for us to migrate code like this to passing OpXxx. For example, we can change the previous code to:

pub fn azblob_put_blob_request(
    &self,
    path: &str,
    size: Option<u64>,
-   content_type: Option<&str>,
-   cache_control: Option<&str>,
+   args: &OpWrite,
    body: AsyncBody,
) -> Result<Request<AsyncBody>> {}

Tasks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions