From dc3d9d0757d6065253839272f6cbde1d40741e6a Mon Sep 17 00:00:00 2001 From: Ferris Tseng Date: Sat, 13 Feb 2021 23:04:45 -0500 Subject: just use Default::default --- ipfs-api/src/client/internal.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ipfs-api/src/client/internal.rs b/ipfs-api/src/client/internal.rs index f75ce75..edf65b8 100644 --- a/ipfs-api/src/client/internal.rs +++ b/ipfs-api/src/client/internal.rs @@ -32,10 +32,6 @@ use std::{ }; use tokio_util::codec::{Decoder, FramedRead}; -fn default() -> T { - Default::default() -} - const FILE_DESCRIPTOR_LIMIT: usize = 127; #[cfg(feature = "with-actix")] @@ -1272,7 +1268,7 @@ impl IpfsClient { self.files_cp_with_options(request::FilesCp { path, dest, - ..default() + ..Default::default() }) .await } @@ -1324,7 +1320,7 @@ impl IpfsClient { /// #[inline] pub async fn files_ls(&self, path: Option<&str>) -> Result { - self.files_ls_with_options(request::FilesLs { path, ..default() }) + self.files_ls_with_options(request::FilesLs { path, ..Default::default() }) .await } @@ -1376,7 +1372,7 @@ impl IpfsClient { self.files_mkdir_with_options(request::FilesMkdir { path, parents: Some(parents), - ..default() + ..Default::default() }) .await } @@ -1429,7 +1425,7 @@ impl IpfsClient { self.files_mv_with_options(request::FilesMv { path, dest, - ..default() + ..Default::default() }) .await } @@ -1522,7 +1518,7 @@ impl IpfsClient { self.files_rm_with_options(request::FilesRm { path, recursive: Some(recursive), - ..default() + ..Default::default() }) .await } @@ -1567,7 +1563,7 @@ impl IpfsClient { /// #[inline] pub async fn files_stat(&self, path: &str) -> Result { - self.files_stat_with_options(request::FilesStat { path, ..default() }) + self.files_stat_with_options(request::FilesStat { path, ..Default::default() }) .await } @@ -1688,7 +1684,7 @@ impl IpfsClient { request::FilesChcid { path: Some(path), cid_version: Some(cid_version), - ..default() + ..Default::default() }, None, ) -- cgit v1.2.3