Skip to content

Commit

Permalink
chore: fix some clippy warning (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Sep 16, 2024
1 parent 0c26c41 commit cba4477
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/ceph_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl CephClient {
user_id: T1,
config_file: T2,
) -> Result<CephClient, RadosError> {
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),
};
Expand Down Expand Up @@ -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::CrushTree, RadosError> {
cmd::osd_tree(&self.rados_t).map_err(|a| a)
cmd::osd_tree(&self.rados_t)
}

/// Get cluster status
Expand Down
5 changes: 1 addition & 4 deletions src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit cba4477

Please sign in to comment.