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

typo fix #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl fmt::Display for LoadJointsError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
LoadJointsError::Io(ref e) => fmt::Display::fmt(&e, f),
LoadJointsError::MissingRoot => f.write_str("The root heirarchy could not be found"),
LoadJointsError::MissingRoot => f.write_str("The root hierarchy could not be found"),
LoadJointsError::MissingJointName { line } => {
write!(f, "{}: the name is missing from the joints section", line)
}
Expand Down
4 changes: 2 additions & 2 deletions src/joint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::{
/// Internal representation of a joint.
#[derive(Clone, Debug, PartialEq)]
pub enum JointData {
/// Root of the skeletal heirarchy.
/// Root of the skeletal hierarchy.
Root {
/// Name of the root `Joint`.
name: JointName,
Expand Down Expand Up @@ -334,7 +334,7 @@ impl JointData {
}
}

/// Get the depth of the `JointData` in the heirarchy.
/// Get the depth of the `JointData` in the hierarchy.
#[inline]
pub(crate) fn depth(&self) -> usize {
match *self {
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
//!
//! ## The bvh file format
//!
//! The `Bvh` file format is comprised of two main sections: the 'Heirarchy' section,
//! The `Bvh` file format is comprised of two main sections: the 'Hierarchy' section,
//! which defines the joints of the skeleton, and the 'Motion' section, which defines
//! the motion values for each channel.
//!
//! This project contains some samples in the [`data` directory][`data` directory].
//!
//! ### Heierarchy
//! ### Hierarchy
//!
//! The 'Heirarchy' section defines the skeleton as a tree of joints, where there is
//! The 'Hierarchy' section defines the skeleton as a tree of joints, where there is
//! a single root joint, and a chain of child joints extending out from each joint,
//! terminated by an 'End Site' section.
//!
Expand All @@ -46,7 +46,7 @@
//! to calculate the length of the final bone in the chain.
//!
//! ```text
//! HEIRARCHY
//! HIERARCHY
//! ROOT <Root-name>
//! {
//! OFFSET <Root-offset-x> <Root-offset-y> <Root-offset-z>
Expand Down
18 changes: 9 additions & 9 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ named! {
)
}
/*
fn heirarchy<'a>(data: &'a [u8]) -> IResult<&'a [u8], Vec<JointData>> {
fn hierarchy<'a>(data: &'a [u8]) -> IResult<&'a [u8], Vec<JointData>> {
let mut joints = Vec::new();
let mut num_channels = 0usize;
let mut joint_index = 0usize;
Expand Down Expand Up @@ -228,7 +228,7 @@ impl Bvh {
&mut self,
lines: &mut EnumeratedLines<'_>,
) -> Result<(), LoadJointsError> {
const HEIRARCHY_KEYWORD: &[u8] = b"HIERARCHY";
const HIERARCHY_KEYWORD: &[u8] = b"HIERARCHY";

const ROOT_KEYWORD: &[u8] = b"ROOT";
const JOINT_KEYWORD: &[u8] = b"JOINT";
Expand All @@ -243,7 +243,7 @@ impl Bvh {
#[derive(Debug, Eq, PartialEq)]
enum ParseMode {
NotStarted,
InHeirarchy,
InHierarchy,
Finished,
}

Expand Down Expand Up @@ -291,15 +291,15 @@ impl Bvh {
};

match first_token.as_bytes() {
HEIRARCHY_KEYWORD => {
HIERARCHY_KEYWORD => {
if curr_mode != ParseMode::NotStarted {
panic!("Unexpected hierarchy");
}
curr_mode = ParseMode::InHeirarchy;
curr_mode = ParseMode::InHierarchy;
next_expected_line = NextExpectedLine::RootName;
}
ROOT_KEYWORD => {
if curr_mode != ParseMode::InHeirarchy
if curr_mode != ParseMode::InHierarchy
|| next_expected_line != NextExpectedLine::RootName
{
panic!("Unexpected root: {:?}", curr_mode);
Expand Down Expand Up @@ -346,7 +346,7 @@ impl Bvh {
}
}
JOINT_KEYWORD => {
if curr_mode != ParseMode::InHeirarchy {
if curr_mode != ParseMode::InHierarchy {
panic!("Unexpected Joint");
}

Expand Down Expand Up @@ -375,7 +375,7 @@ impl Bvh {
}
}
OFFSET_KEYWORD => {
if curr_mode != ParseMode::InHeirarchy {
if curr_mode != ParseMode::InHierarchy {
return Err(LoadJointsError::UnexpectedOffsetSection { line: line_num });
}

Expand Down Expand Up @@ -407,7 +407,7 @@ impl Bvh {
curr_joint.set_offset(offset, in_end_site);
}
CHANNELS_KEYWORD => {
if curr_mode != ParseMode::InHeirarchy {
if curr_mode != ParseMode::InHierarchy {
return Err(LoadJointsError::UnexpectedChannelsSection { line: line_num });
}

Expand Down