Skip to content

Commit

Permalink
Pretty funding banner, 0.36.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
durch committed Sep 2, 2024
1 parent fb1e25e commit 4d9e247
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
3 changes: 2 additions & 1 deletion s3/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust-s3"
version = "0.36.0-alpha.5"
version = "0.36.0-beta.1"
authors = ["Drazen Urch"]
description = "Rust library for working with AWS S3 and compatible object storage APIs"
repository = "https://github.com/durch/rust-s3"
Expand Down Expand Up @@ -40,6 +40,7 @@ path = "../examples/gcs-tokio.rs"


[dependencies]
ansi_term = { version = "0.12" }
async-std = { version = "1", optional = true }
async-trait = "0.1"
attohttpc = { version = "0.28", optional = true, default-features = false }
Expand Down
26 changes: 21 additions & 5 deletions s3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub use awsregion as region;
pub use bucket::Bucket;
pub use bucket::Tag;
pub use bucket_ops::BucketConfiguration;
use log::info;
pub use post_policy::{PostPolicy, PostPolicyChecksum, PostPolicyField, PostPolicyValue};
pub use region::Region;

Expand Down Expand Up @@ -71,16 +70,33 @@ pub fn set_retries(retries: u8) {
/// let retries = s3::get_retries();
/// ```
pub fn get_retries() -> u8 {
RETRIES.load(std::sync::atomic::Ordering::Relaxed) as 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};

if !INITIALIZED.load(std::sync::atomic::Ordering::Relaxed) {
INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst);
info!(
"###############################################################################################################\nSupport further `rust-s3` development by donating BTC to bc1q7ukqe09zplg2sltgfrkukghpelfaz7qja8pw6u. Thank you!\n###############################################################################################################"
);
eprintln!(
" {0}------------------------------------------------------------------------------------------------{0}\n
Support {1} crate development by donating {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!"),
);
}
}

mod test {
#[test]
fn test_funding_call() {
crate::init_once()
}
}

0 comments on commit 4d9e247

Please sign in to comment.