Skip to content

Commit 4348824

Browse files
authored
Merge pull request #662 from robko23/next
small functional improvements
2 parents 4db5809 + 7b92505 commit 4348824

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

async-stripe/src/hyper/client.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,18 @@ impl Client {
109109
let mut last_error = StripeError::ClientError("invalid strategy".into());
110110

111111
if let Some(key) = strategy.get_key() {
112-
req_builder = req_builder.header(HeaderName::from_static("Idempotency-Key"), key);
112+
// false positive from clippy on this lint.
113+
// why this is ok:
114+
// clippy detects any type that has AtomicPtr as interior mutable type and
115+
// by default this lint is disabled for `bytes::Bytes`.
116+
// see this issue for more information:
117+
// https://github.com/rust-lang/rust-clippy/issues/5812
118+
// this struct has two reprs: either standard header name and that is enum of all
119+
// standrd header names, or its represented by `bytes::Bytes`.
120+
// also, on 1.84.1 this does not trigger the false positive
121+
#[allow(clippy::declare_interior_mutable_const)]
122+
const HEADER_NAME: HeaderName = HeaderName::from_static("idempotency-key");
123+
req_builder = req_builder.header(HEADER_NAME, key);
113124
}
114125

115126
loop {

async-stripe/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pub use error::StripeError;
6868
#[cfg(feature = "__hyper")]
6969
pub use hyper::*;
7070
pub use stripe_client_core::{
71-
CustomizedStripeRequest, ListPaginator, PaginationExt, RequestStrategy,
71+
CustomizedStripeRequest, ListPaginator, PaginationExt, RequestStrategy, StripeRequest,
7272
};
7373
pub use stripe_shared::api_errors::*;
7474
pub use stripe_shared::{AccountId, ApplicationId};

0 commit comments

Comments
 (0)