Skip to content

refactor(core): Deprecate not used options in OpList #6050

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

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Changes from all commits
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
30 changes: 6 additions & 24 deletions core/src/raw/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl OpDeleter {
}

/// Args for `list` operation.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Default)]
pub struct OpList {
/// The limit passed to underlying service to specify the max results
/// that could return per-request.
Expand All @@ -96,13 +96,6 @@ pub struct OpList {
///
/// Default to `false`.
recursive: bool,
/// The concurrent of stat operations inside list operation.
/// Users could use this to control the number of concurrent stat operation when metadata is unknown.
///
/// - If this is set to <= 1, the list operation will be sequential.
/// - If this is set to > 1, the list operation will be concurrent,
/// and the maximum number of concurrent operations will be determined by this value.
concurrent: usize,
/// The version is used to control whether the object versions should be returned.
///
/// - If `false`, list operation will not return with object versions
Expand All @@ -121,19 +114,6 @@ pub struct OpList {
deleted: bool,
}

impl Default for OpList {
fn default() -> Self {
OpList {
limit: None,
start_after: None,
recursive: false,
concurrent: 1,
versions: false,
deleted: false,
}
}
}

impl OpList {
/// Create a new `OpList`.
pub fn new() -> Self {
Expand Down Expand Up @@ -181,14 +161,16 @@ impl OpList {
/// Change the concurrent of this list operation.
///
/// The default concurrent is 1.
pub fn with_concurrent(mut self, concurrent: usize) -> Self {
self.concurrent = concurrent;
#[deprecated(since = "0.53.2", note = "concurrent in list is no-op")]
pub fn with_concurrent(self, concurrent: usize) -> Self {
let _ = concurrent;
self
}

/// Get the concurrent of list operation.
#[deprecated(since = "0.53.2", note = "concurrent in list is no-op")]
pub fn concurrent(&self) -> usize {
self.concurrent
0
}

/// Change the version of this list operation
Expand Down
Loading