Skip to content

Commit 1fa44c8

Browse files
authored
fix: remove unnecessary std imports when using custom Errors (#1402)
Signed-off-by: Antoine Lavandier <antoine.lavandier@inria.fr>
1 parent 3a2114d commit 1fa44c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/rust/src/interface.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,7 @@ unsafe fn call_import(&self, _params: Self::ParamsLower, _results: *mut u8) -> u
20052005
if self.r#gen.opts.std_feature {
20062006
self.push_str("#[cfg(feature = \"std\")]\n");
20072007
}
2008-
self.push_str("impl std::error::Error for ");
2008+
self.push_str("impl ::core::error::Error for ");
20092009
self.push_str(&name);
20102010
self.push_str(" {}\n");
20112011
}
@@ -2109,7 +2109,7 @@ unsafe fn call_import(&self, _params: Self::ParamsLower, _results: *mut u8) -> u
21092109
}
21102110
self.push_str("impl");
21112111
self.print_generics(mode.lifetime);
2112-
self.push_str(" std::error::Error for ");
2112+
self.push_str(" ::core::error::Error for ");
21132113
self.push_str(&name);
21142114
self.print_generics(mode.lifetime);
21152115
self.push_str(" {}\n");
@@ -2291,7 +2291,7 @@ unsafe fn call_import(&self, _params: Self::ParamsLower, _results: *mut u8) -> u
22912291
if self.r#gen.opts.std_feature {
22922292
self.push_str("#[cfg(feature = \"std\")]\n");
22932293
}
2294-
self.push_str("impl std::error::Error for ");
2294+
self.push_str("impl ::core::error::Error for ");
22952295
self.push_str(&name);
22962296
self.push_str(" {}\n");
22972297
} else {

0 commit comments

Comments
 (0)