提交 07574363 编写于 作者: D David Rajchenbach-Teller 提交者: Brian Anderson

char.rs: Added a function cmp

上级 07ffe68a
......@@ -94,6 +94,7 @@
} else if c == ch_no_break_space { true } else { false }
}
pure fn to_digit(c: char) -> u8 {
alt c {
'0' to '9' { c as u8 - ('0' as u8) }
......@@ -102,3 +103,10 @@
_ { fail; }
}
}
fn cmp(a: char, b: char) -> int {
ret if b > a { -1 }
else if b < a { 1 }
else { 0 }
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册