Use std.math.clamp

Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>
This commit is contained in:
Jeffrey C. Ollie
2025-04-16 11:06:31 -05:00
parent 8d0c3c7b7c
commit 0e8b266662

View File

@@ -2413,13 +2413,7 @@ pub fn ringBell(self: *Surface) !void {
.required => |path| .{ path, false },
};
const volume: f64 = @min(
@max(
0.0,
self.app.config.@"bell-audio-volume",
),
1.0,
);
const volume = std.math.clamp(self.app.config.@"bell-audio-volume", 0.0, 1.0);
std.debug.assert(std.fs.path.isAbsolute(pathname));
const media_file = gtk.MediaFile.newForFilename(pathname);