Skip to content

Commit

Permalink
Consistent types
Browse files Browse the repository at this point in the history
  • Loading branch information
durch committed Sep 1, 2024
1 parent af9f4fa commit fb1e25e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions s3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ static RETRIES: AtomicU8 = AtomicU8::new(1);
/// # Example
///
/// ```rust
/// use s3::set_retries;
///
/// set_retries(3);
/// s3::set_retries(3);
/// ```
pub fn set_retries(retries: u8) {
RETRIES.store(retries, std::sync::atomic::Ordering::SeqCst);
Expand All @@ -70,12 +68,10 @@ pub fn set_retries(retries: u8) {
/// # Example
///
/// ```rust
/// use s3::get_retries;
///
/// let retries = get_retries();
/// let retries = s3::get_retries();
/// ```
pub fn get_retries() -> u64 {
RETRIES.load(std::sync::atomic::Ordering::Relaxed) as u64
pub fn get_retries() -> u8 {
RETRIES.load(std::sync::atomic::Ordering::Relaxed) as u8
}

#[cfg(not(feature = "disable-call-for-funding"))]
Expand Down
2 changes: 1 addition & 1 deletion s3/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ pub(crate) fn error_from_response_data(response_data: ResponseData) -> Result<S3
macro_rules! retry {
($e:expr) => {{
let mut retry_cnt: u64 = 0;
let max_retries = $crate::get_retries();
let max_retries = $crate::get_retries() as u64;

loop {
match $e {
Expand Down

0 comments on commit fb1e25e

Please sign in to comment.