-
Notifications
You must be signed in to change notification settings - Fork 69
Roll a custom TestEnv and drop lazy_static
#176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,9 @@ pub struct AsyncClient<S = DefaultSleeper> { | |
| max_retries: usize, | ||
| /// Marker for the type of sleeper used | ||
| marker: PhantomData<S>, | ||
| #[allow(unused)] | ||
| /// HTTP headers to append on every request made to Esplora server. | ||
| pub(crate) headers: HashMap<String, String>, // TODO: remove this when `bitreq` is implemented | ||
|
Comment on lines
+48
to
+50
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NACK on adding this field.
I agree that having As an example, you can do it by updating |
||
| } | ||
|
|
||
| impl<S: Sleeper> AsyncClient<S> { | ||
|
|
@@ -62,6 +65,8 @@ impl<S: Sleeper> AsyncClient<S> { | |
| client_builder = client_builder.timeout(core::time::Duration::from_secs(timeout)); | ||
| } | ||
|
|
||
| // TODO: remove this when `bitreq` is implemented | ||
| let headers = builder.headers.clone(); | ||
| if !builder.headers.is_empty() { | ||
| let mut headers = header::HeaderMap::new(); | ||
| for (k, v) in builder.headers { | ||
|
|
@@ -78,6 +83,7 @@ impl<S: Sleeper> AsyncClient<S> { | |
| url: builder.base_url, | ||
| client: client_builder.build()?, | ||
| max_retries: builder.max_retries, | ||
| headers, | ||
| marker: PhantomData, | ||
| }) | ||
| } | ||
|
|
@@ -87,6 +93,7 @@ impl<S: Sleeper> AsyncClient<S> { | |
| AsyncClient { | ||
| url, | ||
| client, | ||
| headers: HashMap::new(), | ||
| max_retries: crate::DEFAULT_MAX_RETRIES, | ||
| marker: PhantomData, | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you have to pin this down to
0.2.11, if the0.2.13already has1.53.0as MSRV ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some transitive dependency was breaking our MSRV.