1
0
mirror of https://github.com/danog/strum.git synced 2024-11-26 20:14:40 +01:00

Use core::* instead of std::* in order to make it work in a no_std environment. (#192)

Co-authored-by: Danny Milosavljevic <daym@oxidecomputer.com>
This commit is contained in:
Danny Milosavljevic 2021-11-18 20:11:02 +01:00 committed by GitHub
parent 5272fcea91
commit 5c0ee93860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,10 +134,10 @@ fn try_from_str(
) -> TokenStream {
quote! {
#[allow(clippy::use_self)]
impl #impl_generics ::std::convert::TryFrom<&str> for #name #ty_generics #where_clause {
impl #impl_generics ::core::convert::TryFrom<&str> for #name #ty_generics #where_clause {
type Error = #strum_module_path::ParseError;
fn try_from(s: &str) -> ::std::result::Result< #name #ty_generics , Self::Error> {
::std::str::FromStr::from_str(s)
fn try_from(s: &str) -> ::core::result::Result< #name #ty_generics , Self::Error> {
::core::str::FromStr::from_str(s)
}
}
}