From 56063069d5c73bca50a96c5449456ad3c05be3df Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Sun, 7 Apr 2024 13:53:53 +0900 Subject: [PATCH] remove -rs suffix from the crate name --- Cargo.toml | 4 ++-- benches/benchmark.rs | 2 +- examples/example.rs | 2 +- src/lib.rs | 8 ++++++-- tests/fixture.rs | 2 +- tests/simple.rs | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ab191a1..aecb44f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "earcut-rs" -version = "0.3.1" +name = "earcut" +version = "0.3.3" edition = "2021" description = "A Rust port of the Earcut polygon triangulation library" authors = ["Taku Fukada ", "MIERUNE Inc. "] diff --git a/benches/benchmark.rs b/benches/benchmark.rs index bf0941b..a7743d0 100644 --- a/benches/benchmark.rs +++ b/benches/benchmark.rs @@ -2,7 +2,7 @@ use std::fs; use criterion::{criterion_group, criterion_main, Criterion}; -use earcut_rs::Earcut; +use earcut::Earcut; fn load_fixture(name: &str) -> (Vec, Vec) { // load JSON diff --git a/examples/example.rs b/examples/example.rs index 072380a..fac05de 100644 --- a/examples/example.rs +++ b/examples/example.rs @@ -1,4 +1,4 @@ -use earcut_rs::{deviation, Earcut}; +use earcut::{deviation, Earcut}; use std::fs; diff --git a/src/lib.rs b/src/lib.rs index f5c20f8..675d90c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,5 @@ +//! A Rust port of the [Earcut](https://github.com/mapbox/earcut) polygon triangulation library. + #![no_std] extern crate alloc; @@ -8,6 +10,7 @@ use alloc::vec::Vec; use core::ptr; use num_traits::float::Float; +/// Index of a vertex pub trait Index: Copy { fn into_usize(self) -> usize; fn from_usize(v: usize) -> Self; @@ -92,6 +95,7 @@ impl Node { } } +/// Instance of the earcut algorithm. pub struct Earcut { data: Vec, nodes: Vec>, @@ -105,9 +109,9 @@ impl Default for Earcut { } impl Earcut { - /// Creates a new instance for the earcut algorithm. + /// Creates a new instance of the earcut algorithm. /// - /// You can reuse the same instance for multiple triangulations to reduce memory allocations. + /// You can reuse a single instance for multiple triangulations to reduce memory allocations. pub fn new() -> Self { Self { data: Vec::new(), diff --git a/tests/fixture.rs b/tests/fixture.rs index e6fbda4..6453aea 100644 --- a/tests/fixture.rs +++ b/tests/fixture.rs @@ -1,4 +1,4 @@ -use earcut_rs::{deviation, Earcut}; +use earcut::{deviation, Earcut}; use std::fs; diff --git a/tests/simple.rs b/tests/simple.rs index 0247b99..91f4eb6 100644 --- a/tests/simple.rs +++ b/tests/simple.rs @@ -1,4 +1,4 @@ -use earcut_rs::{deviation, Earcut}; +use earcut::{deviation, Earcut}; #[test] fn test_empty() {