Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use stricter paths when referring to items #14

Open
tmillr opened this issue Apr 15, 2024 · 0 comments
Open

Use stricter paths when referring to items #14

tmillr opened this issue Apr 15, 2024 · 0 comments

Comments

@tmillr
Copy link

tmillr commented Apr 15, 2024

blanket/src/types/arc.rs

Lines 11 to 13 in ce0b8ab

fn wrap(ty: &syn::Ident) -> syn::Type {
parse_quote!(std::sync::Arc<#ty>)
}

Just a couple small tips/recommendations:

It'd probably be better to use e.g. ::std::sync::Arc instead of std::sync::Arc here (and likewise for all of the other types), otherwise the path refers to whatever is named std in the local scope (which isn't necessarily the std crate).

https://doc.rust-lang.org/reference/paths.html#path-qualifiers

Further these types should be pulled from ::core else ::alloc (if not found in core) as these crates are simply re-exported by std but have the additional benefit of being supported/accessible in no_std crates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant