Skip to content

Commit

Permalink
Remove char::from_u32 call, added note about unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
gchp committed Jan 7, 2015
1 parent 7ee9981 commit f8ba2cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/iota/buffer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//FIXME: Check unicode support
// stdlib dependencies
use std::{ cmp, char };
use std::cmp;
use std::collections::HashMap;
use std::io::{File, Reader, BufferedReader};

Expand Down Expand Up @@ -258,7 +258,8 @@ impl WordEdgeMatch {
/// If c1 -> c2 is the start of a word.
/// If end of word matching is wanted then pass the chars in reversed.
fn is_word_edge(&self, c1: &u8, c2: &u8) -> bool {
match (self, char::from_u32(*c1 as u32).unwrap(), char::from_u32(*c2 as u32).unwrap()) {
// FIXME: unicode support - issue #69
match (self, *c1 as char, *c2 as char) {
(_, '\n', '\n') => true, // Blank lines are always counted as a word
(&WordEdgeMatch::Whitespace, c1, c2) => c1.is_whitespace() && !c2.is_whitespace(),
(&WordEdgeMatch::Alphabet, c1, c2) if c1.is_whitespace() => !c2.is_whitespace(),
Expand Down

0 comments on commit f8ba2cb

Please sign in to comment.