Apply suggestion from @pluiedev

Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>
This commit is contained in:
Everton Correia
2026-01-16 12:25:49 -03:00
committed by GitHub
parent c553296d7a
commit 60da5eb3a6

View File

@@ -61,10 +61,8 @@ pub const Key = enum {
/// const enabled = get(.gtk_enable_primary_paste);
/// const dpi = get(.gtk_xft_dpi);
pub fn get(comptime key: Key) ?key.Type() {
comptime {
if (key.requiresAllocation()) {
@compileError("Allocating types require an allocator; use getAlloc() instead");
}
if (comptime key.requiresAllocation()) {
@compileError("Allocating types require an allocator; use getAlloc() instead");
}
const settings = gtk.Settings.getDefault() orelse return null;
return getImpl(settings, null, key) catch unreachable;