-
Notifications
You must be signed in to change notification settings - Fork 50
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
chore: remove most impl AsRef<str,Path> #157
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mattsse
approved these changes
Jun 28, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reasonable, ty!
I assume we need to update a few calls in foundry after we release this
529922e
to
525270f
Compare
Pending github waking up and running actions |
0d71b66
to
134a307
Compare
ziminq
added a commit
to ziminq/foundry-compilers
that referenced
this pull request
Sep 4, 2024
Due to the this commit: commit bc96471 Author: DaniPopes <[email protected]> Date: Sat Jun 29 00:20:26 2024 +0200 chore: remove most impl AsRef<str,Path> (foundry-rs#157) The interface for `hardhat()` is updated to `&Path`.
mattsse
pushed a commit
that referenced
this pull request
Sep 4, 2024
Due to the this commit: commit bc96471 Author: DaniPopes <[email protected]> Date: Sat Jun 29 00:20:26 2024 +0200 chore: remove most impl AsRef<str,Path> (#157) The interface for `hardhat()` is updated to `&Path`. --------- Co-authored-by: DaniPopes <[email protected]>
klkvr
pushed a commit
that referenced
this pull request
Sep 16, 2024
Due to the this commit: commit bc96471 Author: DaniPopes <[email protected]> Date: Sat Jun 29 00:20:26 2024 +0200 chore: remove most impl AsRef<str,Path> (#157) The interface for `hardhat()` is updated to `&Path`. --------- Co-authored-by: DaniPopes <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These mostly only bloat code size and compilation times, which are already not great when we are already codegenning a billion structs and ASTs with serde derives
For AsRef, the only change is having to specify an extra 1 (one) character (&) when using
String
so it derefs tostr
, otherwise it's the sameFor AsRef it's the same as AsRef when using Path/PathBuf, but it's a bit worse for string literals; but most of these functions are called with variables in the first place. except in tests which will have to use .as_ref() or Path::new
I've not removed these when using with &[] or impl IntoIterator since that does help quite a bit, e.g if you have an owning iterator of Strings, you cannot borrow inside of a map closure
I've also kept Into since that makes more sense, you want to avoid cloning if you can pass in an owned thing already, otherwise you'll clone it yourself
Also fixes some inconsistencies in function signatures for str vs path