use anyhow:Result

This commit is contained in:
weisd
2024-06-28 13:37:56 +08:00
parent a9e515e5c0
commit 4c7c3d4c96
10 changed files with 64 additions and 58 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
use anyhow::Error;
use anyhow::{Error, Result};
use serde::{Deserialize, Serialize};
use serde_json::Error as JsonError;
use uuid::Uuid;
@@ -165,7 +165,7 @@ impl FormatV3 {
/// format, after successful validation.
/// - i'th position is the set index
/// - j'th position is the disk index in the current set
pub fn find_disk_index_by_disk_id(&self, disk_id: Uuid) -> Result<(usize, usize), Error> {
pub fn find_disk_index_by_disk_id(&self, disk_id: Uuid) -> Result<(usize, usize)> {
if disk_id == Uuid::nil() {
return Err(Error::new(disk::DiskError::DiskNotFound));
}