Closed MrXinWang closed 4 years ago
@jiangliu Could you please take another look? Thanks!
Hey @MrXinWang, I think you should squash the commits, as the 2nd change is minor. Good to merge after that :+1:
Hi @aghecenco ! Already squashed these two commits into a single one :) Thanks
impl StdError for Error {}
would have sufficed, I think
or even shorter and more clear to the reader without the use ... as StdError
:
impl std::error::Error for Error {}
@haraldh since this commit is already merged, do you want to submit a fix in a PR?
Referencing issue #58 , a basic implementation is proposed in this PR.
Implemented method
source
fromstd::error::Error
for the custom error typevmm_sys_util::errno::Error
.Added unit test code for above implementation
Personally I think: Since the custom error type
pub struct Error(i32)
is just a wrapper of standard error, therefore there is no underlying error, hence we should always returnNone
in thesource
method. Please do correct me if I am wrong. Thanks very much!Signed-off-by: Henry Wang <henry.wang@arm.com>