Skip to content

Commit 06586aa

Browse files
committed
Make the user agent abreviated
1 parent 6d63e6a commit 06586aa

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

hypersync-client/src/config.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ pub struct ClientConfig {
2222
/// Ceiling time for request backoff.
2323
pub retry_ceiling_ms: Option<u64>,
2424
/// Custom user agent string for HTTP requests.
25-
#[serde(skip_serializing_if = "Option::is_none")]
26-
user_agent: Option<String>,
25+
#[serde(default, skip_serializing_if = "Option::is_none")]
26+
#[doc(hidden)]
27+
pub user_agent: Option<String>,
2728
}
2829

2930
impl ClientConfig {
@@ -33,10 +34,6 @@ impl ClientConfig {
3334
self.user_agent = Some(user_agent.into());
3435
self
3536
}
36-
37-
pub(crate) fn user_agent(&self) -> Option<&str> {
38-
self.user_agent.as_deref()
39-
}
4037
}
4138

4239
/// Config for hypersync event streaming.

hypersync-client/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ impl Client {
7171
.unwrap_or(NonZeroU64::new(30_000).unwrap());
7272

7373
let user_agent = cfg
74-
.user_agent()
75-
.map(|s| s.to_string())
74+
.user_agent
7675
// hscr stands for hypersync client rust
7776
.unwrap_or_else(|| format!("hscr/{}", env!("CARGO_PKG_VERSION")));
7877

0 commit comments

Comments
 (0)