Skip to content

Commit 0dfb6cf

Browse files
authored
don't Implement Display for Val (#10345)
# Objective - Revert #10296 ## Solution - Avoid implementing `Display` without a justification - `Display` implementation is a guarantee without a direct use, takes additional time to compile and require work to maintain - `Debug`, `Reflect` or `Serialize` should cover all needs
1 parent 6f8848a commit 0dfb6cf

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

crates/bevy_ui/src/geometry.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use bevy_reflect::ReflectDeserialize;
44
use bevy_reflect::ReflectSerialize;
55
use serde::Deserialize;
66
use serde::Serialize;
7-
use std::fmt::Display;
87
use std::ops::Neg;
98
use std::ops::{Div, DivAssign, Mul, MulAssign};
109
use thiserror::Error;
@@ -156,22 +155,6 @@ impl DivAssign<f32> for Val {
156155
}
157156
}
158157

159-
impl Display for Val {
160-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
161-
let (value, suffix) = match self {
162-
Val::Auto => return write!(f, "auto"),
163-
Val::Px(value) => (value, "px"),
164-
Val::Percent(value) => (value, "%"),
165-
Val::Vw(value) => (value, "vw"),
166-
Val::Vh(value) => (value, "vh"),
167-
Val::VMin(value) => (value, "vmin"),
168-
Val::VMax(value) => (value, "vmax"),
169-
};
170-
value.fmt(f)?;
171-
write!(f, "{suffix}")
172-
}
173-
}
174-
175158
impl Neg for Val {
176159
type Output = Val;
177160

0 commit comments

Comments
 (0)