-
Notifications
You must be signed in to change notification settings - Fork 1.7k
internal: use consistent style for error handling #15087
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
Conversation
@bors r+ |
☀️ Test successful - checks-actions |
impl fmt::Display for VfsPath { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
match &self.0 { | ||
VfsPathRepr::PathBuf(it) => fmt::Display::fmt(&it.display(), f), | ||
VfsPathRepr::PathBuf(it) => fmt::Debug::fmt(&it, f), | ||
VfsPathRepr::VirtualPath(VirtualPath(it)) => fmt::Display::fmt(it, f), | ||
} | ||
} |
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.
Is this intentional? I think fmt::Display::fmt(&it, f)
is correct here.
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.
Argh, good catch, this is intentional, but messed up!
In this impl, we want to use Display, in the one below we want to use debug.
that is,
fmt::Debug::fmt(&it.display(),
was actually wrong (this calls display impl, but we do want debug here), but I messed this up.
Could you PR this? :)
Fix VfsPath Display and Debug impls fix #15087 (comment) r? `@matklad`
No description provided.