derive(Debug) in most places.#40
Merged
Merged
Conversation
Narsil
approved these changes
Feb 2, 2024
Narsil
left a comment
Contributor
There was a problem hiding this comment.
LGTM.
I kind of prefer if !xx.empty() { Some() } else {None} just because it feels easier to have the happy path first in my mind (unless you use the unhappy paths for early returns + deindent.
make_relative was taken from somewhere on stackoverflow, ideally I'd replace the panic with a proper error but since it's internal it shouldn't make a big difference.
Thanks for the patch!
Contributor
|
Merging this as-is, we can make follow-ups if you want to change the panic into a Result. |
This file contains hidden or 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
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.
This started as wanting to debug print a
Repo. It turned intoDebugon nearly everythingResultonbuild_headersfile1tofileincreate_refbuids->builds,interacto->interact)if+panic!into anassert_eq!inmake_relative(this seems like a bug? I think the assertion is supposed to check both paths are absolute - it currently accepts if both are not absolute paths. I left behavior unchanged)At one point I had
must_usestrewn around after aclippy fixbut I decided to remove them to keep consistent with current practices.