std: Add Option.{result_or_default,or_default} that uses Default

This commit is contained in:
Erick Tryzelaar 2013-09-09 19:32:32 -07:00
parent f1374a7044
commit e6c11313c8
3 changed files with 23 additions and 3 deletions

View file

@ -3461,7 +3461,7 @@ impl Parser {
let ident = self.parse_ident();
let opt_bounds = self.parse_optional_ty_param_bounds();
// For typarams we don't care about the difference b/w "<T>" and "<T:>".
let bounds = opt_bounds.unwrap_or(opt_vec::Empty);
let bounds = opt_bounds.unwrap_or_default();
ast::TyParam { ident: ident, id: ast::DUMMY_NODE_ID, bounds: bounds }
}