Skip to content

Commit ccf5641

Browse files
committed
docs(config): clarify docs and function names
1 parent 03d7fc1 commit ccf5641

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

htsget-config/src/config/advanced/auth/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl AuthConfig {
108108
/// Set the user-agent information from the package info.
109109
pub fn set_from_package_info(&mut self, info: &PackageInfo) -> Result<()> {
110110
let client = self.inner_client_mut();
111-
let builder = client.config()?;
111+
let builder = client.take_config()?;
112112
client.set_config(builder.with_user_agent(info.id.to_string()));
113113

114114
Ok(())

htsget-config/src/config/advanced/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ impl HttpClient {
5656
}
5757
}
5858

59-
/// Get the client builder.
60-
pub fn config(&mut self) -> Result<HttpClientConfig> {
59+
/// Get the client builder by taking out the config value.
60+
pub fn take_config(&mut self) -> Result<HttpClientConfig> {
6161
self
6262
.config
6363
.take()
@@ -75,7 +75,7 @@ impl HttpClient {
7575
return Ok(client);
7676
}
7777

78-
let config = self.config()?;
78+
let config = self.take_config()?;
7979
let mut builder = Client::builder();
8080

8181
let (certs, identity, use_cache, user_agent) = config.into_inner();

htsget-config/src/config/location.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl Locations {
4848
for location in self.as_mut_slice() {
4949
if let Ok(url) = location.backend_mut().as_url_mut() {
5050
let client = url.inner_client_mut();
51-
let builder = client.config()?;
51+
let builder = client.take_config()?;
5252
client.set_config(builder.with_user_agent(_info.id.to_string()));
5353
}
5454
}

htsget-config/src/storage/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl Backend {
116116
if let Backend::Url(url) = self {
117117
Ok(url)
118118
} else {
119-
Err(Error::ParseError("not a `File` variant".to_string()))
119+
Err(Error::ParseError("not a `Url` variant".to_string()))
120120
}
121121
}
122122

@@ -126,7 +126,7 @@ impl Backend {
126126
if let Backend::Url(url) = self {
127127
Ok(url)
128128
} else {
129-
Err(Error::ParseError("not a `File` variant".to_string()))
129+
Err(Error::ParseError("not a `Url` variant".to_string()))
130130
}
131131
}
132132

0 commit comments

Comments
 (0)