Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #876

Closed
wants to merge 1 commit into from
Closed
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 crates/path/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ fn test_reverse_path_simple() {

let mut it = p2.iter_with_attributes();

// Using a function that explicits the argument types works around type inference issue.
// Using a function that explicit the argument types works around type inference issue.
fn check<'l>(
a: Option<Event<(Point, Attributes<'l>), Point>>,
b: Option<Event<(Point, Attributes<'l>), Point>>,
Expand Down Expand Up @@ -1553,7 +1553,7 @@ fn test_reverse_path_1() {

let mut it = p1.reversed().with_attributes();

// Using a function that explicits the argument types works around type inference issue.
// Using a function that explicit the argument types works around type inference issue.
fn check<'l>(
a: Option<Event<(Point, Attributes<'l>), Point>>,
b: Option<Event<(Point, Attributes<'l>), Point>>,
Expand Down
14 changes: 7 additions & 7 deletions crates/tessellation/src/fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::path::{
use crate::{FillGeometryBuilder, Orientation, VertexId};
use crate::{
FillOptions, InternalError, SimpleAttributeStore, TessellationError, TessellationResult,
UnsupportedParamater, VertexSource,
UnsupportedParameter, VertexSource,
};
use float_next_after::NextAfter;
use std::cmp::Ordering;
Expand Down Expand Up @@ -200,7 +200,7 @@ struct ActiveEdges {
}

struct Span {
/// We store `MonotoneTesselator` behind a `Box` for performance purposes.
/// We store `MonotoneTessellator` behind a `Box` for performance purposes.
/// For more info, see [Issue #621](https://github.com/nical/lyon/pull/621).
tess: Option<Box<MonotoneTessellator>>,
}
Expand All @@ -221,7 +221,7 @@ impl Span {
struct Spans {
spans: Vec<Span>,

/// We store `MonotoneTesselator` behind a `Box` for performance purposes.
/// We store `MonotoneTessellator` behind a `Box` for performance purposes.
/// For more info, see [Issue #621](https://github.com/nical/lyon/pull/621).
#[allow(clippy::vec_box)]
pool: Vec<Box<MonotoneTessellator>>,
Expand Down Expand Up @@ -751,8 +751,8 @@ impl FillTessellator {
builder: &mut dyn FillGeometryBuilder,
) -> TessellationResult {
if options.tolerance.is_nan() || options.tolerance <= 0.0 {
return Err(TessellationError::UnsupportedParamater(
UnsupportedParamater::ToleranceIsNaN,
return Err(TessellationError::UnsupportedParameter(
UnsupportedParameter::ToleranceIsNaN,
));
}

Expand Down Expand Up @@ -867,8 +867,8 @@ impl FillTessellator {
self.current_position = self.events.position(current_event);

if self.current_position.x.is_nan() || self.current_position.y.is_nan() {
return Err(TessellationError::UnsupportedParamater(
UnsupportedParamater::PositionIsNaN,
return Err(TessellationError::UnsupportedParameter(
UnsupportedParameter::PositionIsNaN,
));
}

Expand Down
4 changes: 2 additions & 2 deletions crates/tessellation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ pub enum InternalError {
pub enum TessellationError {
// TODO Parameter typo
#[error("Unsupported parameter: {0}")]
UnsupportedParamater(UnsupportedParamater),
UnsupportedParameter(UnsupportedParameter),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch! Shame on me.

Unfortunately this is an API breaking change so I'll have to wait for other compelling changes to merge it and do a 2.0.0 release.

#[error("Geometry builder error: {0}")]
GeometryBuilder(#[from] GeometryBuilderError),
#[error("Internal error: {0}")]
Internal(#[from] InternalError),
}

#[derive(Error, Clone, Debug, PartialEq)]
pub enum UnsupportedParamater {
pub enum UnsupportedParameter {
#[error("Position is not a number")]
PositionIsNaN,
#[error("Tolerance threshold is not a number")]
Expand Down