feat: impl Display for FilterType#3071
Conversation
|
What's the motivation for this? As is, this implementation of |
Yes, it will be the same but it will use the Display Trait instead of the Debug which is more correct in case of printing it |
What do you mean by "correct"? Could you please explain when and why the |
Debug is for developers and Display for end user. Therefore I prefer to use Display |
That much the documentation of those traits says... I'm asking why you chose |
| match self { | ||
| FilterType::Nearest => write!(f, "Nearest"), | ||
| FilterType::Triangle => write!(f, "Triangle"), | ||
| FilterType::CatmullRom => write!(f, "CatmullRom"), |
There was a problem hiding this comment.
There's different requirements here, end-User display implementations should prefer plain english and avoid code formatting. We might certainly consider if Display is applicable but making it work like Debug is not going to happen as I find that simply misleading. Since I can't really convince myself of any particular capitalization, I'm afraid that FilterType has too narrow a scope for implementing Display.
The OsString::display() method demonstrates another alternative to be considered (not done, considered!). Maybe there's context in which all the above ambiguity is resolved and an expected (english) representation exists?
There was a problem hiding this comment.
Okay I've edited the MR, feel free to close it if needed
Hello
What do you think about impl display for FilterType ?