From 9ba955842913c9e1060bdb98deef9d645917b5cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Mon, 15 Feb 2021 23:59:31 +0100 Subject: [PATCH 1/2] Allow dead code explicitly in `iced_web` --- web/src/widget/button.rs | 2 ++ web/src/widget/checkbox.rs | 1 + web/src/widget/container.rs | 1 + web/src/widget/radio.rs | 1 + web/src/widget/scrollable.rs | 1 + web/src/widget/slider.rs | 2 ++ 6 files changed, 8 insertions(+) diff --git a/web/src/widget/button.rs b/web/src/widget/button.rs index e7cff6a0..7c389a9f 100644 --- a/web/src/widget/button.rs +++ b/web/src/widget/button.rs @@ -25,8 +25,10 @@ pub struct Button<'a, Message> { content: Element<'a, Message>, on_press: Option, width: Length, + #[allow(dead_code)] height: Length, min_width: u32, + #[allow(dead_code)] min_height: u32, padding: u16, style: Box, diff --git a/web/src/widget/checkbox.rs b/web/src/widget/checkbox.rs index 543af99a..43110aa7 100644 --- a/web/src/widget/checkbox.rs +++ b/web/src/widget/checkbox.rs @@ -30,6 +30,7 @@ pub struct Checkbox { label: String, id: Option, width: Length, + #[allow(dead_code)] style: Box, } diff --git a/web/src/widget/container.rs b/web/src/widget/container.rs index 7187a4f0..8de3cc41 100644 --- a/web/src/widget/container.rs +++ b/web/src/widget/container.rs @@ -12,6 +12,7 @@ pub struct Container<'a, Message> { width: Length, height: Length, max_width: u32, + #[allow(dead_code)] max_height: u32, horizontal_alignment: Align, vertical_alignment: Align, diff --git a/web/src/widget/radio.rs b/web/src/widget/radio.rs index 5a9bc379..fbc88d29 100644 --- a/web/src/widget/radio.rs +++ b/web/src/widget/radio.rs @@ -37,6 +37,7 @@ pub struct Radio { label: String, id: Option, name: Option, + #[allow(dead_code)] style: Box, } diff --git a/web/src/widget/scrollable.rs b/web/src/widget/scrollable.rs index f9135dd6..bd9260ff 100644 --- a/web/src/widget/scrollable.rs +++ b/web/src/widget/scrollable.rs @@ -11,6 +11,7 @@ pub struct Scrollable<'a, Message> { height: Length, max_height: u32, content: Column<'a, Message>, + #[allow(dead_code)] style: Box, } diff --git a/web/src/widget/slider.rs b/web/src/widget/slider.rs index 91a4d2ec..f457aa4c 100644 --- a/web/src/widget/slider.rs +++ b/web/src/widget/slider.rs @@ -38,7 +38,9 @@ pub struct Slider<'a, T, Message> { step: T, value: T, on_change: Rc Message>>, + #[allow(dead_code)] width: Length, + #[allow(dead_code)] style: Box, } From ec20763aef242bfa52f1d1afb910d36c903343dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Tue, 16 Feb 2021 00:04:36 +0100 Subject: [PATCH 2/2] Use string literal as panic message in `iced_glow` --- glow/src/program.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glow/src/program.rs b/glow/src/program.rs index 489a194f..601f9ce6 100644 --- a/glow/src/program.rs +++ b/glow/src/program.rs @@ -17,7 +17,7 @@ pub unsafe fn create( gl.compile_shader(shader); if !gl.get_shader_compile_status(shader) { - panic!(gl.get_shader_info_log(shader)); + panic!("{}", gl.get_shader_info_log(shader)); } gl.attach_shader(program, shader); @@ -27,7 +27,7 @@ pub unsafe fn create( gl.link_program(program); if !gl.get_program_link_status(program) { - panic!(gl.get_program_info_log(program)); + panic!("{}", gl.get_program_info_log(program)); } for shader in shaders {