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

feat: implement no_std #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jun-sheaf
Copy link

@jun-sheaf jun-sheaf commented Oct 22, 2023

Uses the original path rather than hardcoding std. This provides more flexibility for imports.

Comment on lines +67 to +70
match segments.last() {
Some(syn::PathSegment { ident, .. }) => ident == "Cow",
_ => false,
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this accidentially adds support for beef.

Well, it's no problem. Before getting rid of the duck typing there is really no way to tell with #14.

Is it clear to you what is the segments.last() == None case? if not, could add unreachable!() or segments.last().expect("type must always have at least one segment"). Or maybe could use the error reporting facilities of syn, which haven't been used so far.

Copy link
Author

@jun-sheaf jun-sheaf Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Erroring here is not meaningful. It will error downstream, so it's not wrong to use false.

Regarding beef, I suspect it will support beef. I wouldn't say this is bad; I think it's well-known to not name types after standard types unless it's planned for complete compatibility.

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

Successfully merging this pull request may close these issues.

None yet

2 participants