[types] Move Char trait down to just above impl
This commit is contained in:
parent
1430bdad29
commit
0133bbed19
1 changed files with 6 additions and 6 deletions
|
|
@ -7,12 +7,6 @@ mod names;
|
||||||
use object::Object;
|
use object::Object;
|
||||||
use predicates::IsChar;
|
use predicates::IsChar;
|
||||||
|
|
||||||
pub trait Char {
|
|
||||||
fn from_char(c: char) -> Object;
|
|
||||||
fn from_char_named(name: &str) -> Option<Object>;
|
|
||||||
fn char_name(&self) -> Option<String>;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl IsChar for Object {
|
impl IsChar for Object {
|
||||||
fn is_char(&self) -> bool {
|
fn is_char(&self) -> bool {
|
||||||
match *self {
|
match *self {
|
||||||
|
|
@ -22,6 +16,12 @@ impl IsChar for Object {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub trait Char {
|
||||||
|
fn from_char(c: char) -> Object;
|
||||||
|
fn from_char_named(name: &str) -> Option<Object>;
|
||||||
|
fn char_name(&self) -> Option<String>;
|
||||||
|
}
|
||||||
|
|
||||||
impl Char for Object {
|
impl Char for Object {
|
||||||
fn from_char(c: char) -> Object {
|
fn from_char(c: char) -> Object {
|
||||||
Object::Char(c)
|
Object::Char(c)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue