F32, F64,
Char,
Bool,
- Nil,
+ Unit,
Str,
Slice,
PrimitiveTuple,
"u32" => Some(U32),
"u64" => Some(U64),
"bool" => Some(Bool),
- "nil" => Some(Nil),
+ "unit" => Some(Unit),
"char" => Some(Char),
"str" => Some(Str),
"f32" => Some(F32),
Str => "str",
Bool => "bool",
Char => "char",
- Nil => "()",
+ Unit => "()",
Slice => "slice",
PrimitiveTuple => "tuple",
}
pub fn to_url_str(&self) -> &'static str {
match *self {
- Nil => "nil",
+ Unit => "unit",
other => other.to_str(),
}
}
fn clean(&self) -> Type {
use syntax::ast::*;
match self.node {
- TyNil => Primitive(Nil),
+ TyNil => Primitive(Unit),
TyPtr(ref m) => RawPointer(m.mutbl.clean(), box m.ty.clean()),
TyRptr(ref l, ref m) =>
BorrowedRef {lifetime: l.clean(), mutability: m.mutbl.clean(),
fn clean(&self) -> Type {
match ty::get(*self).sty {
ty::ty_bot => Bottom,
- ty::ty_nil => Primitive(Nil),
+ ty::ty_nil => Primitive(Unit),
ty::ty_bool => Primitive(Bool),
ty::ty_char => Primitive(Char),
ty::ty_int(ast::TyI) => Primitive(Int),
},
args = decl.decl.inputs,
arrow = match decl.decl.output {
- clean::Primitive(clean::Nil) => "".to_string(),
+ clean::Primitive(clean::Unit) => "".to_string(),
_ => format!(" -> {}", decl.decl.output),
},
bounds = {
m.collect::<Vec<String>>().connect(" + "))
},
arrow = match decl.decl.output {
- clean::Primitive(clean::Nil) => "".to_string(),
+ clean::Primitive(clean::Unit) => "".to_string(),
_ => format!(" -> {}", decl.decl.output)
})
}
write!(f, "({args}){arrow}",
args = self.inputs,
arrow = match self.output {
- clean::Primitive(clean::Nil) => "".to_string(),
+ clean::Primitive(clean::Unit) => "".to_string(),
_ => format!(" -> {}", self.output),
})
}
write!(f, "({args}){arrow}",
args = args,
arrow = match d.output {
- clean::Primitive(clean::Nil) => "".to_string(),
+ clean::Primitive(clean::Unit) => "".to_string(),
_ => format!(" -> {}", d.output),
})
}