From 8e7f7763c7821563aa2f3e93829b16a18398899a Mon Sep 17 00:00:00 2001 From: durch Date: Fri, 6 Sep 2024 20:24:04 +0200 Subject: [PATCH] Remove funding banner, closes #401 --- s3/Cargo.toml | 4 +--- s3/src/bucket.rs | 4 +--- s3/src/lib.rs | 36 ------------------------------------ 3 files changed, 2 insertions(+), 42 deletions(-) diff --git a/s3/Cargo.toml b/s3/Cargo.toml index 666e94df51..0f5e2e4b3d 100644 --- a/s3/Cargo.toml +++ b/s3/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust-s3" -version = "0.36.0-beta.1" +version = "0.36.0-beta.2" authors = ["Drazen Urch"] description = "Rust library for working with AWS S3 and compatible object storage APIs" repository = "https://github.com/durch/rust-s3" @@ -117,8 +117,6 @@ sync-native-tls-vendored = [ ] sync-rustls-tls = ["attohttpc/tls-rustls", "aws-creds/rustls-tls", "sync"] -disable-call-for-funding = [] - [dev-dependencies] tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "fs"] } async-std = { version = "1", features = ["attributes"] } diff --git a/s3/src/bucket.rs b/s3/src/bucket.rs index 551834d22e..10d2344247 100644 --- a/s3/src/bucket.rs +++ b/s3/src/bucket.rs @@ -94,7 +94,7 @@ use crate::serde_types::{ }; #[allow(unused_imports)] use crate::utils::{error_from_response_data, PutStreamResponse}; -use crate::{init_once, PostPolicy}; +use crate::PostPolicy; use http::header::HeaderName; use http::HeaderMap; @@ -600,8 +600,6 @@ impl Bucket { region: Region, credentials: Credentials, ) -> Result, S3Error> { - #[cfg(not(feature = "disable-call-for-funding"))] - init_once(); #[cfg(feature = "with-tokio")] let options = ClientOptions::default(); diff --git a/s3/src/lib.rs b/s3/src/lib.rs index e97950bb09..e43bc083b6 100644 --- a/s3/src/lib.rs +++ b/s3/src/lib.rs @@ -4,7 +4,6 @@ #[macro_use] extern crate serde_derive; -use std::sync::atomic::AtomicBool; use std::sync::atomic::AtomicU8; pub use awscreds as creds; @@ -32,9 +31,6 @@ const LONG_DATETIME: &[time::format_description::FormatItem<'static>] = time::macros::format_description!("[year][month][day]T[hour][minute][second]Z"); const EMPTY_PAYLOAD_SHA: &str = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; -#[cfg(not(feature = "disable-call-for-funding"))] -static INITIALIZED: AtomicBool = AtomicBool::new(false); - static RETRIES: AtomicU8 = AtomicU8::new(1); /// Sets the number of retries for operations that may fail and need to be retried. @@ -72,35 +68,3 @@ pub fn set_retries(retries: u8) { pub fn get_retries() -> u8 { RETRIES.load(std::sync::atomic::Ordering::Relaxed) } - -#[cfg(not(feature = "disable-call-for-funding"))] -#[inline(always)] -pub(crate) fn init_once() { - use ansi_term::{ - Colour::{Blue, Yellow}, - Style, - }; - - if !INITIALIZED.load(std::sync::atomic::Ordering::Relaxed) { - INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst); - eprintln!( - " {0}---------------------------------------------------------------------------------{0}\n - Support {1} crate -> {5} {2} to {3} \n - {0}--- {4} ---{0} \n - {0}---------------------------------------------------------------------------------{0}", - Yellow.bold().paint("<>"), - Yellow.bold().paint("rust-s3"), - Yellow.bold().paint("BTC"), - Yellow.bold().paint("bc1q7ukqe09zplg2sltgfrkukghpelfaz7qja8pw6u"), - Blue.bold().paint("Thank You!"), - Style::new().bold().underline().paint("donate"), - ); - } -} - -mod test { - #[test] - fn test_funding_call() { - crate::init_once() - } -}