Skip to content

Commit

Permalink
remove -rs suffix from the crate name (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscorn authored Apr 7, 2024
1 parent dd24643 commit 0923060
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <naninunenor@gmail.com>", "MIERUNE Inc. <info@mierune.co.jp>"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion benches/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f64>, Vec<usize>) {
// load JSON
Expand Down
2 changes: 1 addition & 1 deletion examples/example.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use earcut_rs::{deviation, Earcut};
use earcut::{deviation, Earcut};

use std::fs;

Expand Down
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! A Rust port of the [Earcut](https://github.com/mapbox/earcut) polygon triangulation library.

#![no_std]

extern crate alloc;
Expand All @@ -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;
Expand Down Expand Up @@ -92,6 +95,7 @@ impl<T: Float> Node<T> {
}
}

/// Instance of the earcut algorithm.
pub struct Earcut<T: Float> {
data: Vec<T>,
nodes: Vec<Node<T>>,
Expand All @@ -105,9 +109,9 @@ impl<T: Float> Default for Earcut<T> {
}

impl<T: Float> Earcut<T> {
/// 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(),
Expand Down
2 changes: 1 addition & 1 deletion tests/fixture.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use earcut_rs::{deviation, Earcut};
use earcut::{deviation, Earcut};

use std::fs;

Expand Down
2 changes: 1 addition & 1 deletion tests/simple.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use earcut_rs::{deviation, Earcut};
use earcut::{deviation, Earcut};

#[test]
fn test_empty() {
Expand Down

0 comments on commit 0923060

Please sign in to comment.