diff --git a/src/gelatin/application.rs b/src/gelatin/application.rs index 2302273b..996e43c3 100644 --- a/src/gelatin/application.rs +++ b/src/gelatin/application.rs @@ -97,6 +97,7 @@ impl Application { self.windows.insert(window.get_id(), window); } + #[allow(dead_code)] pub fn add_global_event_handler< F: FnMut(&Event<()>) -> NextUpdate + 'static, >( diff --git a/src/gelatin/misc.rs b/src/gelatin/misc.rs index 0e0d7bcb..6232fcf8 100644 --- a/src/gelatin/misc.rs +++ b/src/gelatin/misc.rs @@ -153,6 +153,7 @@ pub struct LogicalRect { } impl LogicalRect { + #[allow(dead_code)] #[inline] pub fn left(&self) -> f32 { self.pos.vec.x diff --git a/src/gelatin/mod.rs b/src/gelatin/mod.rs index bf81c2b3..9deee58f 100644 --- a/src/gelatin/mod.rs +++ b/src/gelatin/mod.rs @@ -1,7 +1,7 @@ //! Idk man use std::{ - any::Any, error::Error, fmt, ops::Deref, path::PathBuf, rc::Rc, + any::Any, error::Error, fmt, path::PathBuf, rc::Rc, time::Instant, vec::Vec, }; @@ -29,7 +29,6 @@ pub mod window; #[derive(Debug)] pub enum WidgetError { Image(image::ImageError), - Custom(Box), } impl fmt::Display for WidgetError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -37,9 +36,6 @@ impl fmt::Display for WidgetError { WidgetError::Image(img_err) => { write!(f, "WidgetError: Image ({})", img_err)? } - WidgetError::Custom(err) => { - write!(f, "WidgetError: Custom ({})", err)? - } } Ok(()) } @@ -48,7 +44,6 @@ impl Error for WidgetError { fn source(&self) -> Option<&(dyn Error + 'static)> { match self { WidgetError::Image(img_err) => Some(img_err), - WidgetError::Custom(err) => Some(Deref::deref(err)), } } } @@ -267,6 +262,7 @@ pub fn widget_data_ptr(rc: &Rc) -> *const u8 { #[macro_export] macro_rules! add_common_widget_functions { ($data_field:ident) => { + #[allow(dead_code)] pub fn set_margin_all(&self, pixels: f32) { let mut borrowed = self.$data_field.borrow_mut(); borrowed.placement.margin_left = pixels; @@ -276,21 +272,25 @@ macro_rules! add_common_widget_functions { borrowed.render_validity.invalidate(); } + #[allow(dead_code)] pub fn set_margin_left(&self, pixels: f32) { let mut borrowed = self.$data_field.borrow_mut(); borrowed.placement.margin_left = pixels; borrowed.render_validity.invalidate(); } + #[allow(dead_code)] pub fn set_margin_right(&self, pixels: f32) { let mut borrowed = self.$data_field.borrow_mut(); borrowed.placement.margin_right = pixels; borrowed.render_validity.invalidate(); } + #[allow(dead_code)] pub fn set_margin_top(&self, pixels: f32) { let mut borrowed = self.$data_field.borrow_mut(); borrowed.placement.margin_top = pixels; borrowed.render_validity.invalidate(); } + #[allow(dead_code)] pub fn set_margin_bottom(&self, pixels: f32) { let mut borrowed = self.$data_field.borrow_mut(); borrowed.placement.margin_bottom = pixels; diff --git a/src/gelatin/picture.rs b/src/gelatin/picture.rs index 020e2a72..f53d2b21 100644 --- a/src/gelatin/picture.rs +++ b/src/gelatin/picture.rs @@ -40,6 +40,7 @@ pub struct Picture { } impl Picture { + #[allow(dead_code)] pub fn new>(path: T) -> Picture { Picture { data: RefCell::new(PictureData::Path(path.into())),