aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/config/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty_terminal/src/config/mod.rs')
-rw-r--r--alacritty_terminal/src/config/mod.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/alacritty_terminal/src/config/mod.rs b/alacritty_terminal/src/config/mod.rs
index f63f6ebb..f17c327f 100644
--- a/alacritty_terminal/src/config/mod.rs
+++ b/alacritty_terminal/src/config/mod.rs
@@ -234,13 +234,7 @@ impl Default for Percentage {
impl Percentage {
pub fn new(value: f32) -> Self {
- Percentage(if value < 0.0 {
- 0.0
- } else if value > 1.0 {
- 1.0
- } else {
- value
- })
+ Percentage(value.clamp(0., 1.))
}
pub fn as_f32(self) -> f32 {