diff --git a/src/ceph_client.rs b/src/ceph_client.rs index 25499d0..732124f 100644 --- a/src/ceph_client.rs +++ b/src/ceph_client.rs @@ -46,7 +46,7 @@ impl CephClient { user_id: T1, config_file: T2, ) -> Result { - let rados_t = match connect_to_ceph(&user_id.as_ref(), &config_file.as_ref()) { + let rados_t = match connect_to_ceph(user_id.as_ref(), config_file.as_ref()) { Ok(rados_t) => rados_t, Err(e) => return Err(e), }; @@ -170,11 +170,11 @@ impl CephClient { /// # } /// ``` pub fn osd_unset(&self, key: OsdOption) -> Result<(), RadosError> { - cmd::osd_unset(&self.rados_t, &key, self.simulate).map_err(|a| a) + cmd::osd_unset(&self.rados_t, &key, self.simulate) } pub fn osd_tree(&self) -> Result { - cmd::osd_tree(&self.rados_t).map_err(|a| a) + cmd::osd_tree(&self.rados_t) } /// Get cluster status diff --git a/src/cmd.rs b/src/cmd.rs index e134b83..6e7cedd 100644 --- a/src/cmd.rs +++ b/src/cmd.rs @@ -1376,10 +1376,7 @@ pub fn osd_safe_to_destroy(cluster_handle: &Rados, osd_id: u64) -> bool { "prefix": "osd safe-to-destroy", "ids": [osd_id.to_string()] }); - match cluster_handle.ceph_mon_command_without_data(&cmd) { - Err(_) => false, - Ok(_) => true, - } + cluster_handle.ceph_mon_command_without_data(&cmd).is_ok() } /// count ceph-mgr daemons by metadata field property diff --git a/src/error.rs b/src/error.rs index a48d2ff..cc3ad7d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -50,7 +50,7 @@ impl fmt::Display for RadosError { match *self { RadosError::FromUtf8Error(ref e) => f.write_str(&e.to_string()), RadosError::NulError(ref e) => f.write_str(&e.to_string()), - RadosError::Error(ref e) => f.write_str(&e), + RadosError::Error(ref e) => f.write_str(e), RadosError::IoError(ref e) => f.write_str(&e.to_string()), RadosError::ApiError(ref e) => e.fmt(f), RadosError::IntoStringError(ref e) => f.write_str(&e.to_string()),