Skip to content

Commit a05b2c5

Browse files
committed
Don't use new rust features
1 parent 82195ef commit a05b2c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/net_protocol.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,18 @@ impl<S: crate::store::Store> Builder<S> {
172172

173173
/// Set custom [`ConcurrencyLimits`] to use.
174174
pub fn concurrency_limits(mut self, concurrency_limits: ConcurrencyLimits) -> Self {
175-
let downloader_config = self.downloader_config.get_or_insert_default();
175+
let downloader_config = self
176+
.downloader_config
177+
.get_or_insert_with(|| Default::default());
176178
downloader_config.concurrency = concurrency_limits;
177179
self
178180
}
179181

180182
/// Set a custom [`RetryConfig`] to use.
181183
pub fn retry_config(mut self, retry_config: RetryConfig) -> Self {
182-
let downloader_config = self.downloader_config.get_or_insert_default();
184+
let downloader_config = self
185+
.downloader_config
186+
.get_or_insert_with(|| Default::default());
183187
downloader_config.retry = retry_config;
184188
self
185189
}

0 commit comments

Comments
 (0)