Skip to content

Commit

Permalink
Rust 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
msrd0 committed Feb 21, 2025
1 parent e92360e commit 912a6e6
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 21 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ members = [
"rlottie-sys"
]

[workspace.package]
license = "MIT"
repository = "https://github.com/msrd0/rlottie-rs"
edition = "2024"
rust-version = "1.85"

[profile.test]
opt-level = 3
12 changes: 6 additions & 6 deletions lottieconv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
workspace = ".."
name = "lottieconv"
version = "0.3.0"
license = "MIT"
include = ["src/**/*.rs", "bin/*.rs", "/LICENSE", "/README.md"]

description = "Convert lottie files to WEBP or GIF"
keywords = ["lottie", "webp", "gif", "convert"]
repository = "https://github.com/msrd0/rlottie-rs"
include = ["src/**/*.rs", "bin/*.rs", "/LICENSE", "/README.md"]

license.workspace = true
repository.workspace = true
edition.workspace = true
rust-version.workspace = true

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

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion lottieconv/src/convert.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rgb::{alt::BGRA8, RGBA8};
use rgb::{RGBA8, alt::BGRA8};
use std::convert::Infallible;

pub trait Convert {
Expand Down
4 changes: 2 additions & 2 deletions lottieconv/src/gif.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{convert::Convert, Rgba};
use crate::{Rgba, convert::Convert};
use gif_crate::{DisposalMethod, Encoder, EncodingError, Frame, Repeat};
use rgb::{alt::BGRA8, RGBA8};
use rgb::{RGBA8, alt::BGRA8};
use rlottie::Size;
use std::io::Write;

Expand Down
2 changes: 1 addition & 1 deletion lottieconv/src/webp.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::convert::Convert;
use rgb::{alt::BGRA8, RGBA8};
use rgb::{RGBA8, alt::BGRA8};
use rlottie::Size;
use webp_animation::{Encoder, WebPData};

Expand Down
Binary file added lottieconv/tests/example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lottieconv/tests/example.webp
Binary file not shown.
11 changes: 5 additions & 6 deletions rlottie/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
workspace = ".."
name = "rlottie"
version = "0.5.2"
license = "MIT"
include = ["build.rs", "src/**/*.rs", "/LICENSE"]

description = "A platform independent standalone library that plays Lottie Animation"
repository = "https://github.com/msrd0/rlottie-rs"
include = ["build.rs", "src/**/*.rs", "/LICENSE"]

edition = "2021"
rust-version = "1.60"
license.workspace = true
repository.workspace = true
edition.workspace = true
rust-version.workspace = true

[features]
serde = ["dep:serde", "rgb/serde"]
Expand Down
4 changes: 3 additions & 1 deletion rlottie/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
fn main() {
#[cfg(target_endian = "big")]
println!("cargo:warning=rlottie-rs has not been tested on big endian targets. It might be unsound. Use at your own risk.");
println!(
"cargo:warning=rlottie-rs has not been tested on big endian targets. It might be unsound. Use at your own risk."
);
}
6 changes: 3 additions & 3 deletions rlottie/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//! # }
//! ```
use rgb::{alt::BGRA, RGB};
use rgb::{RGB, alt::BGRA};
use rlottie_sys::*;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -151,7 +151,7 @@ impl Surface {
}

/// Returns an iterator over the pixels of the surface.
pub fn pixels(&self) -> impl Iterator<Item = (usize, usize, Bgra)> + '_ {
pub fn pixels(&self) -> impl Iterator<Item = (usize, usize, Bgra)> {
let width = self.width();
self.data().iter().enumerate().map(move |(i, color)| {
let x = i % width;
Expand All @@ -167,7 +167,7 @@ impl Surface {

/// Set the length of the pixel data to `width * height`.
unsafe fn set_len(&mut self) {
self.data.set_len(self.width() * self.height())
unsafe { self.data.set_len(self.width() * self.height()) }
}
}

Expand Down
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
edition = "2021"
edition = "2024"
max_width = 85
newline_style = "Unix"
unstable_features = true
Expand Down

0 comments on commit 912a6e6

Please sign in to comment.