From fde627d955bd0d7b1211587a0fc08442bf00e079 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 10 Feb 2025 13:29:00 +0300 Subject: Implement MulAssign for Color --- niri-config/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs index 880a08e9..e20b0f49 100644 --- a/niri-config/src/lib.rs +++ b/niri-config/src/lib.rs @@ -3,7 +3,7 @@ extern crate tracing; use std::collections::HashSet; use std::ffi::OsStr; -use std::ops::Mul; +use std::ops::{Mul, MulAssign}; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::time::Duration; @@ -822,6 +822,12 @@ impl Mul for Color { } } +impl MulAssign for Color { + fn mul_assign(&mut self, rhs: f32) { + self.a *= rhs; + } +} + #[derive(knuffel::Decode, Debug, PartialEq)] pub struct Cursor { #[knuffel(child, unwrap(argument), default = String::from("default"))] -- cgit