Skip to content

Commit

Permalink
Fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Jan 3, 2020
1 parent 5281f41 commit d8b47b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Cargo.lock
.DS_Store
Thumbs.db
/.idea
/.vscode
16 changes: 8 additions & 8 deletions src/ini.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl Default for ParseOption {

/// Newline style
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum LineSpearator {
pub enum LineSeparator {
/// System-dependent line separator
///
/// On UNIX system, uses "\n"
Expand All @@ -196,19 +196,19 @@ static DEFAULT_LINE_SEPARATOR: &str = "\n";
#[cfg(windows)]
static DEFAULT_LINE_SEPARATOR: &str = "\r\n";

impl fmt::Display for LineSpearator {
impl fmt::Display for LineSeparator {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
f.write_str(self.as_str())
}
}

impl LineSpearator {
impl LineSeparator {
/// String representation
pub fn as_str(&self) -> &'static str {
match *self {
LineSpearator::SystemDefault => DEFAULT_LINE_SEPARATOR,
LineSpearator::CR => "\n",
LineSpearator::CRLF => "\r\n",
LineSeparator::SystemDefault => DEFAULT_LINE_SEPARATOR,
LineSeparator::CR => "\n",
LineSeparator::CRLF => "\r\n",
}
}
}
Expand All @@ -219,13 +219,13 @@ pub struct WriteOption {
pub escape_policy: EscapePolicy,

/// Newline style
pub line_separator: LineSpearator,
pub line_separator: LineSeparator,
}

impl Default for WriteOption {
fn default() -> WriteOption {
WriteOption { escape_policy: EscapePolicy::Basics,
line_separator: LineSpearator::SystemDefault }
line_separator: LineSeparator::SystemDefault }
}
}

Expand Down

0 comments on commit d8b47b4

Please sign in to comment.