Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelOsborne committed Jun 19, 2024
1 parent 233c466 commit 7703c9a
Showing 1 changed file with 11 additions and 36 deletions.
47 changes: 11 additions & 36 deletions dotlottie-rs/src/dotlottie_player.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use core::num;
use instant::{Duration, Instant};
use std::sync::RwLock;
use std::{fs, rc::Rc, sync::Arc};
Expand Down Expand Up @@ -1417,7 +1416,7 @@ impl DotLottiePlayer {

match command_type {
"Bool" => {
let bool_value = value.parse::<bool>().map_err(|_| (return false));
let bool_value = value.parse::<bool>().map_err(|_| (false));

match bool_value {
Ok(bool_value) => {
Expand Down Expand Up @@ -1455,7 +1454,7 @@ impl DotLottiePlayer {
}
}
"Numeric" => {
let numeric_value = value.parse::<f32>().map_err(|_| (return false));
let numeric_value = value.parse::<f32>().map_err(|_| (false));

match numeric_value {
Ok(numeric_value) => {
Expand Down Expand Up @@ -1483,14 +1482,8 @@ impl DotLottiePlayer {
return false;
}
let pointer_event = Event::OnPointerDown {
x: values[0]
.parse::<f32>()
.map_err(|_| (return false))
.unwrap(),
y: values[1]
.parse::<f32>()
.map_err(|_| (return false))
.unwrap(),
x: values[0].parse::<f32>().map_err(|_| (false)).unwrap(),
y: values[1].parse::<f32>().map_err(|_| (false)).unwrap(),
};
match self.state_machine.try_write() {
Ok(mut state_machine) => {
Expand All @@ -1509,14 +1502,8 @@ impl DotLottiePlayer {
return false;
}
let pointer_event = Event::OnPointerUp {
x: values[0]
.parse::<f32>()
.map_err(|_| (return false))
.unwrap(),
y: values[1]
.parse::<f32>()
.map_err(|_| (return false))
.unwrap(),
x: values[0].parse::<f32>().map_err(|_| (false)).unwrap(),
y: values[1].parse::<f32>().map_err(|_| (false)).unwrap(),
};
match self.state_machine.try_write() {
Ok(mut state_machine) => {
Expand All @@ -1535,14 +1522,8 @@ impl DotLottiePlayer {
return false;
}
let pointer_event = Event::OnPointerMove {
x: values[0]
.parse::<f32>()
.map_err(|_| (return false))
.unwrap(),
y: values[1]
.parse::<f32>()
.map_err(|_| (return false))
.unwrap(),
x: values[0].parse::<f32>().map_err(|_| (false)).unwrap(),
y: values[1].parse::<f32>().map_err(|_| (false)).unwrap(),
};
match self.state_machine.try_write() {
Ok(mut state_machine) => {
Expand All @@ -1561,14 +1542,8 @@ impl DotLottiePlayer {
return false;
}
let pointer_event = Event::OnPointerEnter {
x: values[0]
.parse::<f32>()
.map_err(|_| (return false))
.unwrap(),
y: values[1]
.parse::<f32>()
.map_err(|_| (return false))
.unwrap(),
x: values[0].parse::<f32>().map_err(|_| (false)).unwrap(),
y: values[1].parse::<f32>().map_err(|_| (false)).unwrap(),
};
match self.state_machine.try_write() {
Ok(mut state_machine) => {
Expand Down Expand Up @@ -1614,7 +1589,7 @@ impl DotLottiePlayer {
}
_ => return false,
}
return true;
true
}

pub fn load_animation_path(&self, animation_path: &str, width: u32, height: u32) -> bool {
Expand Down

0 comments on commit 7703c9a

Please sign in to comment.