mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-11 07:36:53 +00:00
opt
This commit is contained in:
@@ -98,7 +98,11 @@ impl Clone for Error {
|
||||
if let Some(e) = self.downcast_ref::<DiskError>() {
|
||||
clone_disk_err(e)
|
||||
} else if let Some(e) = self.downcast_ref::<io::Error>() {
|
||||
Error::new(io::Error::new(e.kind(), e.to_string()))
|
||||
if let Some(code) = e.raw_os_error() {
|
||||
Error::new(io::Error::from_raw_os_error(code))
|
||||
} else {
|
||||
Error::new(io::Error::new(e.kind(), e.to_string()))
|
||||
}
|
||||
} else {
|
||||
// TODO: 优化其他类型
|
||||
Error::msg(self.to_string())
|
||||
|
||||
Reference in New Issue
Block a user