Closed
Description
What I expect:
impl fmt::Display for RemoteObject {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match &self.object_type {
RemoteObjectType::Undefined => write!(f, "undefined"),
RemoteObjectType::Boolean
| RemoteObjectType::String => self.display_value(f),
RemoteObjectType::Null
| RemoteObjectType::Object => self.display_object(f),
RemoteObjectType::BigInt
| RemoteObjectType::Number
| RemoteObjectType::Symbol
| RemoteObjectType::Function => self.display_description(f),
}
}
}
What rustfmt
produces:
impl fmt::Display for RemoteObject {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match &self.object_type {
RemoteObjectType::Undefined => write!(f, "undefined"),
RemoteObjectType::Boolean | RemoteObjectType::String => self.display_value(f),
RemoteObjectType::Null | RemoteObjectType::Object => self.display_object(f),
RemoteObjectType::BigInt
| RemoteObjectType::Number
| RemoteObjectType::Symbol
| RemoteObjectType::Function => self.display_description(f),
}
}
}
If this isn't a bug - happy to close! Might just be a personal preference of mine :)