summaryrefslogtreecommitdiffstats
path: root/alacritty_terminal/src/config/mod.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2022-10-12 04:40:46 +0000
committerGitHub <noreply@github.com>2022-10-12 07:40:46 +0300
commit21c75d9d94e1a338501d2011f17710ff5174ac01 (patch)
tree310d88754f399dc0fe4f8abdc68ba2d4097bdefd /alacritty_terminal/src/config/mod.rs
parent182086f59c0148508c31d359eaee2cfef059f45c (diff)
Fix clippy warnings
This patch applies all clippy lints currently present on the latest clippy master than are compatible with our oldstable clippy (only exception is the `_else(||` stuff).
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 {