Skip to content

Commit

Permalink
remove -rs suffix from the crate name
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscorn committed Apr 7, 2024
1 parent dd24643 commit ac3e12f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
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.3"
edition = "2021"
description = "A Rust port of the Earcut polygon triangulation library"
authors = ["Taku Fukada <[email protected]>", "MIERUNE Inc. <[email protected]>"]
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 ac3e12f

Please sign in to comment.