Skip to content

Commit

Permalink
improve encapsulation
Browse files Browse the repository at this point in the history
  • Loading branch information
tsfotis committed Sep 19, 2024
1 parent 652bd64 commit d441184
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions core/src/services/cloudflare_kv/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,12 @@ impl kv::Adapter for Adapter {
}

#[derive(Debug, Deserialize)]
pub(crate) struct CfKvResponse {
pub(crate) errors: Vec<CfKvError>,
pub(super) struct CfKvResponse {
pub(super) errors: Vec<CfKvError>,
}

#[derive(Debug, Deserialize)]
pub(crate) struct CfKvScanResponse {
pub(super) struct CfKvScanResponse {
result: Vec<CfKvScanResult>,
// According to https://developers.cloudflare.com/api/operations/workers-kv-namespace-list-a-namespace'-s-keys, result_info is used to determine if there are more keys to be listed
// result_info: Option<CfKvResultInfo>,
Expand All @@ -292,8 +292,8 @@ struct CfKvScanResult {
// }

#[derive(Debug, Deserialize)]
pub(crate) struct CfKvError {
pub(crate) code: i32,
pub(super) struct CfKvError {
pub(super) code: i32,
}

#[cfg(test)]
Expand Down
4 changes: 2 additions & 2 deletions core/src/services/cloudflare_kv/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::raw::*;
use crate::*;

/// Parse error response into Error.
pub(crate) fn parse_error(resp: Response<Buffer>) -> Error {
pub(super) fn parse_error(resp: Response<Buffer>) -> Error {
let (parts, mut body) = resp.into_parts();
let bs = body.copy_to_bytes(body.remaining());

Expand Down Expand Up @@ -62,7 +62,7 @@ pub(crate) fn parse_error(resp: Response<Buffer>) -> Error {
err
}

pub(crate) fn parse_cfkv_error_code(errors: Vec<CfKvError>) -> Option<(ErrorKind, bool)> {
pub(super) fn parse_cfkv_error_code(errors: Vec<CfKvError>) -> Option<(ErrorKind, bool)> {
if errors.is_empty() {
return None;
}
Expand Down

0 comments on commit d441184

Please sign in to comment.