Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test

on:
merge_group:
pull_request:
push:
branches:
- master

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: macos-latest
- os: ubuntu-latest

steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- uses: dtolnay/rust-toolchain@stable

- name: Test native build
run: cargo build --verbose --locked

- name: Run simple tests
run: cargo test --verbose

- name: Run heavy tests
run: cargo test --verbose -- --ignored
288 changes: 288 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
[package]
name = "sirop"
version = "0.1.0"
license = "EPL-2.0"
edition = "2024"
homepage = "https://github.com/rami3l/sirop"
repository = "https://github.com/rami3l/sirop"
description = "A libspiro port in pure Rust."

[dependencies]
thiserror = "2.0.17"

[dev-dependencies]
insta = "1.45.0"

[lints.rust]
missing_copy_implementations = "warn"
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Sirop

This is a manual port of [`spiro-js`] from TypeScript to Rust, trying to become
a truly readable and maintainable Rust-native alternative to [`spiro-sys-rs`].

Please refer to [`spiro-js`] for the licensing and authorship of the original
code.

[`spiro-js`]: https://github.com/be5invis/spiro-js
[`spiro-sys-rs`]: https://github.com/Pangpang-Studio/spiro-sys-rs
12 changes: 12 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
edition = "2024"
unstable_features = true

format_macro_matchers = true
format_macro_bodies = true
group_imports = "StdExternalCrate"
imports_granularity = "Crate"
reorder_impl_items = true
wrap_comments = true

use_field_init_shorthand = true
trailing_semicolon = true
15 changes: 15 additions & 0 deletions src/bez.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
mod strand;

pub use self::strand::{Ctx as StrandCtx, Strand};
use crate::Point;

pub trait Ctx {
fn move_to(&mut self, to: Point);
fn line_to(&mut self, to: Point);
fn cubic_to(&mut self, c1: Point, c2: Point, to: Point);

fn mark_knot(&mut self, _idx: usize) {}

fn start(&mut self) {}
fn end(&mut self) {}
}
Loading