Skip to content

Commit e6c2f91

Browse files
committed
Make the user agent abreviated
1 parent 1c31249 commit e6c2f91

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
@@ -25,8 +25,9 @@ pub struct ClientConfig {
2525
#[serde(default)]
2626
pub serialization_format: SerializationFormat,
2727
/// Custom user agent string for HTTP requests.
28-
#[serde(skip_serializing_if = "Option::is_none")]
29-
user_agent: Option<String>,
28+
#[serde(default, skip_serializing_if = "Option::is_none")]
29+
#[doc(hidden)]
30+
pub user_agent: Option<String>,
3031
}
3132

3233
impl ClientConfig {
@@ -36,10 +37,6 @@ impl ClientConfig {
3637
self.user_agent = Some(user_agent.into());
3738
self
3839
}
39-
40-
pub(crate) fn user_agent(&self) -> Option<&str> {
41-
self.user_agent.as_deref()
42-
}
4340
}
4441

4542
/// Determines query serialization format for HTTP requests.

hypersync-client/src/lib.rs

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

7676
let user_agent = cfg
77-
.user_agent()
78-
.map(|s| s.to_string())
77+
.user_agent
7978
// hscr stands for hypersync client rust
8079
.unwrap_or_else(|| format!("hscr/{}", env!("CARGO_PKG_VERSION")));
8180

0 commit comments

Comments
 (0)