-
Notifications
You must be signed in to change notification settings - Fork 88
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
Fix formatting panic for 0.13.x #749
Conversation
(cherry picked from commit 26cce04)
This ensures that we don't get an error on formatting a value without a debug protocol. (fixes rune-rs#747)
I'm not sure if there are any tests that also need to be backported or not. |
LGTM! Did you intend to fix the Debug impl for Value as well to not return |
The fix I did seems to work for my use case (no more panics), but it can still return error indeed. I'm not sure under what conditions that can happen though. But since posting this PR I did manage to hit that path again: let cmd = process::Command::new("ls");
cmd.arg("-l");
let child = cmd.spawn();
dbg(cmd); (This fails because So perhaps we should also add something like the |
Instead attempt to print *something*
4626a56
to
60f2f54
Compare
With the latest change we now get debug prints like: |
That's great! I think there's still the is_err thing in the Debug impl (can't check right now) which we should probably get rid off? Regardless I'll merge this when I'm home. Thanks! |
I must have missed this, not sure what is left at this point? |
You're right. Thank you! |
Two commits are needed to fix this on 0.13:
Result:Err
). This is a cherry pick from mainValue::string_debug_with
. This is manual backport of the way the code is now done in main and fixes the observed crash.(fixes #747)