Skip to content

Commit

Permalink
chore: 🤖 eliminate the use of unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
theashraf committed Jan 18, 2024
1 parent 551fa87 commit a129518
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions dotlottie-rs/src/lottie_renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,20 @@ impl LottieRenderer {
self.width = width;
self.height = height;

let thorvg_animation = self.thorvg_animation.as_mut().unwrap();
let thorvg_canvas = self.thorvg_canvas.as_mut().unwrap();
let thorvg_background_shape = self.thorvg_background_shape.as_mut().unwrap();
let thorvg_animation = self
.thorvg_animation
.as_mut()
.ok_or(LottieRendererError::AnimationNotLoaded)?;

let thorvg_canvas = self
.thorvg_canvas
.as_mut()
.ok_or(LottieRendererError::AnimationNotLoaded)?;

let thorvg_background_shape = self
.thorvg_background_shape
.as_mut()
.ok_or(LottieRendererError::AnimationNotLoaded)?;

thorvg_canvas
.set_target(
Expand Down Expand Up @@ -109,9 +120,20 @@ impl LottieRenderer {
self.width = width;
self.height = height;

let thorvg_animation = self.thorvg_animation.as_mut().unwrap();
let thorvg_canvas = self.thorvg_canvas.as_mut().unwrap();
let thorvg_background_shape = self.thorvg_background_shape.as_mut().unwrap();
let thorvg_animation = self
.thorvg_animation
.as_mut()
.ok_or(LottieRendererError::AnimationNotLoaded)?;

let thorvg_canvas = self
.thorvg_canvas
.as_mut()
.ok_or(LottieRendererError::AnimationNotLoaded)?;

let thorvg_background_shape = self
.thorvg_background_shape
.as_mut()
.ok_or(LottieRendererError::AnimationNotLoaded)?;

thorvg_canvas
.set_target(
Expand Down

0 comments on commit a129518

Please sign in to comment.