mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-06 07:17:27 +00:00
feat: use Self instead of struct name whereas applicable
This commit is contained in:
parent
f53635993e
commit
1877a16457
2 changed files with 4 additions and 4 deletions
|
|
@ -224,7 +224,7 @@ pub struct EcoRequestSettings {
|
|||
|
||||
impl From<ExtraRequestSettings> for EcoRequestSettings {
|
||||
fn from(value: ExtraRequestSettings) -> Self {
|
||||
EcoRequestSettings {
|
||||
Self {
|
||||
hostname: value.hostname,
|
||||
}
|
||||
}
|
||||
|
|
@ -232,7 +232,7 @@ impl From<ExtraRequestSettings> for EcoRequestSettings {
|
|||
|
||||
impl From<EcoRequestSettings> for HttpSettings<String> {
|
||||
fn from(value: EcoRequestSettings) -> Self {
|
||||
HttpSettings {
|
||||
Self {
|
||||
protocol: HttpProtocol::Http,
|
||||
hostname: value.hostname,
|
||||
headers: Vec::with_capacity(0),
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ impl HttpClient {
|
|||
url: U,
|
||||
timeout_settings: &Option<TimeoutSettings>,
|
||||
headers: Option<Vec<(&str, &str)>>,
|
||||
) -> GDResult<HttpClient>
|
||||
) -> GDResult<Self>
|
||||
where
|
||||
U::Error: std::error::Error + Send + Sync + 'static,
|
||||
{
|
||||
|
|
@ -229,7 +229,7 @@ impl HttpClient {
|
|||
headers: headers.unwrap_or_default(),
|
||||
};
|
||||
|
||||
HttpClient::new(&address, timeout_settings, http_settings)
|
||||
Self::new(&address, timeout_settings, http_settings)
|
||||
}
|
||||
|
||||
/// Send a HTTP GET request and return the response data as a buffer.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue