Skip to content

Commit cf661f5

Browse files
SeaDvebilelmoussaoui
authored andcommitted
gdk: Make RGBA::new const
1 parent 3ff3e76 commit cf661f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gdk4/src/rgba.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ impl RGBABuilder {
6767

6868
impl RGBA {
6969
#[inline]
70-
pub fn new(red: f32, green: f32, blue: f32, alpha: f32) -> Self {
70+
pub const fn new(red: f32, green: f32, blue: f32, alpha: f32) -> Self {
7171
skip_assert_initialized!();
72-
unsafe {
73-
Self::unsafe_from(ffi::GdkRGBA {
72+
Self {
73+
inner: ffi::GdkRGBA {
7474
red,
7575
green,
7676
blue,
7777
alpha,
78-
})
78+
},
7979
}
8080
}
8181

0 commit comments

Comments
 (0)