Skip to content

Commit

Permalink
Bump MSRV
Browse files Browse the repository at this point in the history
  • Loading branch information
staticintlucas committed Jun 10, 2024
1 parent c4e0f2c commit c8805d1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [stable, 1.70.0]
rust: [stable, 1.74.1]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resolver = "2"
version = "0.3.2"
authors = ["Lucas Jansen"]
edition = "2021"
rust-version = "1.70"
rust-version = "1.74"
repository = "https://github.com/staticintlucas/keyset-rs"
license = "MIT OR Apache-2.0"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[test status]: https://img.shields.io/github/actions/workflow/status/staticintlucas/keyset-rs/test.yml?branch=main&label=tests&style=flat-square
[test coverage]: https://img.shields.io/codecov/c/gh/staticintlucas/keyset-rs?style=flat-square
[crate version]: https://img.shields.io/crates/v/keyset?style=flat-square
[rust version]: https://img.shields.io/badge/rust-1.70%2B-informational?style=flat-square
[rust version]: https://img.shields.io/badge/rust-1.74%2B-informational?style=flat-square

[actions]: https://github.com/staticintlucas/keyset-rs/actions?query=branch%3Amain
[codecov]: https://app.codecov.io/github/staticintlucas/keyset-rs
Expand All @@ -12,7 +12,7 @@
A (WIP) reimplementation of [pykeyset] in Rust for improved performance.
Eventually this aims to become the backend for pykeyset using a Python wrapper around this project.

Current minimum supported Rust version is 1.70.0, although this is subject to change as development continues.
Current minimum supported Rust version is 1.74.0, although this is subject to change as development continues.

[pykeyset]: https://github.com/staticintlucas/pykeyset

Expand Down
14 changes: 6 additions & 8 deletions keyset-color/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,32 +97,30 @@ impl Color {
#[inline]
#[must_use]
pub fn as_rgb8(&self) -> (u8, u8, u8) {
let [r, g, b] = self.0.map(|c| (c * 256.0).saturating_into());
(r, g, b)
self.0.map(|c| (c * 256.0).saturating_into()).into()
}

/// Returns a tuple containing the red, green, and blue components as [`u16`].
#[inline]
#[must_use]
pub fn as_rgb16(&self) -> (u16, u16, u16) {
let [r, g, b] = self.0.map(|c| (c * 65536.0).saturating_into());
(r, g, b)
self.0.map(|c| (c * 65536.0).saturating_into()).into()
}

/// Creates a new [`Color`] from a tuple containing the red, green, and blue
/// components as [`u8`].
#[inline]
#[must_use]
pub fn from_rgb8((r, g, b): (u8, u8, u8)) -> Self {
[r, g, b].map(|c| f32::from(c) / 255.0).into()
pub fn from_rgb8(rgb: (u8, u8, u8)) -> Self {
<[u8; 3]>::from(rgb).map(|c| f32::from(c) / 255.0).into()
}

/// Creates a new [`Color`] from a tuple containing the red, green, and blue
/// components as [`u16`].
#[inline]
#[must_use]
pub fn from_rgb16((r, g, b): (u16, u16, u16)) -> Self {
[r, g, b].map(|c| f32::from(c) / 65535.0).into()
pub fn from_rgb16(rgb: (u16, u16, u16)) -> Self {
<[u16; 3]>::from(rgb).map(|c| f32::from(c) / 65535.0).into()
}

/// Returns a slice containing the red, green, and blue components of the colour.
Expand Down
5 changes: 2 additions & 3 deletions keyset-geom/src/path/arc_to_bezier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ pub fn arc_to_bezier<U>(
(0..i_segments)
.map(|i| phi0 + dphi * i.into()) // Starting angle for segment
.map(|phi0| create_arc(r, phi0, dphi)) // Create segment arc
.map(|(ctrl1, ctrl2, point)| {
.map(|vecs| {
// Re-rotate by xar
let [ctrl1, ctrl2, point] = [ctrl1, ctrl2, point].map(|p| p.rotate(xar));
(ctrl1, ctrl2, point)
<[Vector<_>; 3]>::from(vecs).map(|p| p.rotate(xar)).into()
})
.collect()
}
Expand Down

0 comments on commit c8805d1

Please sign in to comment.