Skip to content

Commit

Permalink
Add (De)Serialize impls for Size struct (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
msrd0 authored Nov 4, 2022
1 parent d75ea9f commit 9affdcf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lottieconv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository = "https://github.com/msrd0/rlottie-rs"
documentation = "https://docs.msrd0.de/lottieconv/0.2.1/lottieconv/"

edition = "2021"
rust-version = "1.56"
rust-version = "1.60"
autobins = false

[[bin]]
Expand All @@ -28,9 +28,9 @@ required-features = ["clap", "webp"]

[features]
default = ["gif", "webp"]
gif = ["gif_crate"]
gif = ["dep:gif_crate"]
serde = ["rgb/serde", "rlottie/serde"]
webp = ["webp-animation"]
webp = ["dep:webp-animation"]

[dependencies]
clap = { version = "4.0", features = ["derive"], optional = true }
Expand Down
5 changes: 3 additions & 2 deletions rlottie/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ repository = "https://github.com/msrd0/rlottie-rs"
documentation = "https://docs.msrd0.de/rlottie/0.5.1/rlottie/"

edition = "2021"
rust-version = "1.56"
rust-version = "1.60"

[features]
serde = ["rgb/serde"]
serde = ["dep:serde", "rgb/serde"]

[dependencies]
rgb = { version = "0.8.32", default-features = false }
rlottie-sys = { path = "../rlottie-sys", version = "0.2" }
serde = { version = "1", features = ["derive"], optional = true }
3 changes: 3 additions & 0 deletions rlottie/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
use rgb::{alt::BGRA, RGB};
use rlottie_sys::*;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use std::{
ffi::CString,
fmt::{self, Debug},
Expand Down Expand Up @@ -56,6 +58,7 @@ where

/// The size type used by lottie [`Animation`].
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
pub struct Size {
pub width: usize,
pub height: usize
Expand Down

0 comments on commit 9affdcf

Please sign in to comment.