Skip to content

Commit 2e46ffb

Browse files
committed
Silence dead code warnings
1 parent ad5d169 commit 2e46ffb

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/gelatin/application.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ impl Application {
9797
self.windows.insert(window.get_id(), window);
9898
}
9999

100+
#[allow(dead_code)]
100101
pub fn add_global_event_handler<
101102
F: FnMut(&Event<()>) -> NextUpdate + 'static,
102103
>(

src/gelatin/misc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ pub struct LogicalRect {
153153
}
154154

155155
impl LogicalRect {
156+
#[allow(dead_code)]
156157
#[inline]
157158
pub fn left(&self) -> f32 {
158159
self.pos.vec.x

src/gelatin/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Idk man
22
33
use std::{
4-
any::Any, error::Error, fmt, ops::Deref, path::PathBuf, rc::Rc,
4+
any::Any, error::Error, fmt, path::PathBuf, rc::Rc,
55
time::Instant, vec::Vec,
66
};
77

@@ -29,17 +29,13 @@ pub mod window;
2929
#[derive(Debug)]
3030
pub enum WidgetError {
3131
Image(image::ImageError),
32-
Custom(Box<dyn Error>),
3332
}
3433
impl fmt::Display for WidgetError {
3534
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3635
match self {
3736
WidgetError::Image(img_err) => {
3837
write!(f, "WidgetError: Image ({})", img_err)?
3938
}
40-
WidgetError::Custom(err) => {
41-
write!(f, "WidgetError: Custom ({})", err)?
42-
}
4339
}
4440
Ok(())
4541
}
@@ -48,7 +44,6 @@ impl Error for WidgetError {
4844
fn source(&self) -> Option<&(dyn Error + 'static)> {
4945
match self {
5046
WidgetError::Image(img_err) => Some(img_err),
51-
WidgetError::Custom(err) => Some(Deref::deref(err)),
5247
}
5348
}
5449
}
@@ -267,6 +262,7 @@ pub fn widget_data_ptr(rc: &Rc<dyn Widget>) -> *const u8 {
267262
#[macro_export]
268263
macro_rules! add_common_widget_functions {
269264
($data_field:ident) => {
265+
#[allow(dead_code)]
270266
pub fn set_margin_all(&self, pixels: f32) {
271267
let mut borrowed = self.$data_field.borrow_mut();
272268
borrowed.placement.margin_left = pixels;
@@ -276,21 +272,25 @@ macro_rules! add_common_widget_functions {
276272
borrowed.render_validity.invalidate();
277273
}
278274

275+
#[allow(dead_code)]
279276
pub fn set_margin_left(&self, pixels: f32) {
280277
let mut borrowed = self.$data_field.borrow_mut();
281278
borrowed.placement.margin_left = pixels;
282279
borrowed.render_validity.invalidate();
283280
}
281+
#[allow(dead_code)]
284282
pub fn set_margin_right(&self, pixels: f32) {
285283
let mut borrowed = self.$data_field.borrow_mut();
286284
borrowed.placement.margin_right = pixels;
287285
borrowed.render_validity.invalidate();
288286
}
287+
#[allow(dead_code)]
289288
pub fn set_margin_top(&self, pixels: f32) {
290289
let mut borrowed = self.$data_field.borrow_mut();
291290
borrowed.placement.margin_top = pixels;
292291
borrowed.render_validity.invalidate();
293292
}
293+
#[allow(dead_code)]
294294
pub fn set_margin_bottom(&self, pixels: f32) {
295295
let mut borrowed = self.$data_field.borrow_mut();
296296
borrowed.placement.margin_bottom = pixels;

src/gelatin/picture.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ pub struct Picture {
4040
}
4141

4242
impl Picture {
43+
#[allow(dead_code)]
4344
pub fn new<T: Into<path::PathBuf>>(path: T) -> Picture {
4445
Picture {
4546
data: RefCell::new(PictureData::Path(path.into())),

0 commit comments

Comments
 (0)