From 4703d9239bd669386965d2a66f3051d6830a4ef1 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 --- .github/workflows/Test.yml | 2 +- Cargo.toml | 4 ++-- README.md | 2 +- benches/benchmark.rs | 2 +- examples/example.rs | 2 +- src/lib.rs | 8 ++++++-- tests/fixture.rs | 2 +- tests/simple.rs | 2 +- 8 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index d8cc8e8..3757a57 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -32,7 +32,7 @@ jobs: - name: Test run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} files: lcov.info diff --git a/Cargo.toml b/Cargo.toml index ab191a1..3f8dbfa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "earcut-rs" -version = "0.3.1" +name = "earcut" +version = "0.3.4" edition = "2021" description = "A Rust port of the Earcut polygon triangulation library" authors = ["Taku Fukada ", "MIERUNE Inc. "] diff --git a/README.md b/README.md index 06d8434..de3ee12 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Test](https://github.com/MIERUNE/earcut-rs/actions/workflows/Test.yml/badge.svg)](https://github.com/MIERUNE/earcut-rs/actions/workflows/Test.yml) [![codecov](https://codecov.io/gh/MIERUNE/earcut-rs/graph/badge.svg?token=thKlQiVjLc)](https://codecov.io/gh/MIERUNE/earcut-rs) -[![Crates.io Version](https://img.shields.io/crates/v/earcut-rs)](https://crates.io/crates/earcut-rs) +[![Crates.io Version](https://img.shields.io/crates/v/earcut)](https://crates.io/crates/earcut) A Rust port of the [mapbox/earcut](https://github.com/mapbox/earcut) polygon triangulation library, implemented from scratch with some reference to [donbright/earcutr](https://github.com/donbright/earcutr). 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() {