Use `std.math.clamp`

Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>
pull/5326/head
Jeffrey C. Ollie 2025-04-16 11:06:31 -05:00
parent 8d0c3c7b7c
commit 0e8b266662
No known key found for this signature in database
GPG Key ID: 6F86035A6D97044E
1 changed files with 1 additions and 7 deletions

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);