Skip to content
Open
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
4 changes: 2 additions & 2 deletions Cargo.lock

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

9 changes: 6 additions & 3 deletions crates/extra/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
[package]
name = "lyon_extra"
version = "1.0.3"
version = "1.1.0"
description = "Various optional utilities for the lyon crate."
authors = ["Nicolas Silva <nical@fastmail.com>"]
repository = "https://github.com/nical/lyon"
documentation = "https://docs.rs/lyon_extra/"
license = "MIT OR Apache-2.0"
workspace = "../.."
edition = "2018"

[lib]
name = "lyon_extra"

[features]
default = ["std"]
serialization = ["lyon_path/serialization"]
std = ["thiserror/std", "lyon_path/std"]

[dependencies]
lyon_path = { version = "1.0.0", path = "../path" }
thiserror = "1.0"
lyon_path = { version = "1.0.0", path = "../path", default-features = false }
thiserror = { version = "2.0", default-features = false }
4 changes: 2 additions & 2 deletions crates/extra/src/debugging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use path::math::Point;
use path::PathEvent;
use path::{Path, PathSlice};

use std::{println, vec::Vec, panic};

pub type Polygons = Vec<Vec<Point>>;
pub type PolygonsRef<'a> = &'a [Vec<Point>];

Expand Down Expand Up @@ -105,8 +107,6 @@ pub fn find_reduced_test_case<F: Fn(Path) -> bool + panic::UnwindSafe + panic::R
path
}

use std::panic;

fn find_reduced_test_case_sp<F>(mut polygons: Polygons, cb: &F) -> Polygons
where
F: Fn(Path) -> bool + panic::UnwindSafe + panic::RefUnwindSafe,
Expand Down
9 changes: 9 additions & 0 deletions crates/extra/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@
#![deny(bare_trait_objects)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![no_std]

extern crate lyon_path as path;

extern crate alloc;

#[cfg(any(test, feature = "std"))]
#[macro_use]
extern crate std;


pub use path::geom::euclid;
pub use path::math;

#[cfg(any(test, feature = "std"))]
pub mod debugging;
pub mod parser;
pub mod rust_logo;
8 changes: 5 additions & 3 deletions crates/extra/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ use path::{
math::{point, vector, Angle, Point},
traits::PathBuilder,
};
use core::{mem};

extern crate thiserror;
extern crate alloc;
use alloc::{string::String, vec::Vec};

use self::thiserror::Error;
use thiserror::Error;

#[non_exhaustive]
#[derive(Error, Clone, Debug, PartialEq)]
Expand Down Expand Up @@ -457,7 +459,7 @@ impl PathParser {
match self.float_buffer.parse::<f32>() {
Ok(val) => Ok(val),
Err(_) => Err(ParseError::Number {
src: std::mem::take(&mut self.float_buffer),
src: mem::take(&mut self.float_buffer),
line,
column,
}),
Expand Down