From eae3a56c30caa607803d6139569a744c293c1dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Tue, 14 Nov 2023 22:47:45 +0100 Subject: [PATCH] Fix clippy warning, use unwrap_or_default() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- core/src/spclient.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/spclient.rs b/core/src/spclient.rs index d6c5ffb1..fbb8ddc5 100644 --- a/core/src/spclient.rs +++ b/core/src/spclient.rs @@ -392,7 +392,7 @@ impl SpClient { ) -> SpClientResult { let body = protobuf::text_format::print_to_string(message); - let mut headers = headers.unwrap_or_else(HeaderMap::new); + let mut headers = headers.unwrap_or_default(); headers.insert( CONTENT_TYPE, HeaderValue::from_static("application/x-protobuf"), @@ -409,7 +409,7 @@ impl SpClient { headers: Option, body: Option<&str>, ) -> SpClientResult { - let mut headers = headers.unwrap_or_else(HeaderMap::new); + let mut headers = headers.unwrap_or_default(); headers.insert(ACCEPT, HeaderValue::from_static("application/json")); self.request(method, endpoint, Some(headers), body).await