Skip to content

Commit c54f7a8

Browse files
committed
stop using ::std::num::Zero
1 parent 02d8918 commit c54f7a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/codegen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ fn getter_text (_node_map : &collections::hash_map::HashMap<u64, schema_capnp::n
464464
}
465465
}
466466

467-
fn common_case<T: ::std::num::Zero + ::std::fmt::Show>(
467+
fn common_case<T: ::std::num::FromPrimitive + PartialEq + ::std::fmt::Show>(
468468
typ: &str, member : &str,
469469
offset: uint, default : T) -> (String, FormattedText) {
470-
let interior = if default.is_zero() {
470+
let interior = if default == ::std::num::FromPrimitive::from_uint(0).unwrap() {
471471
Line(format!("self.{}.get_data_field::<{}>({})",
472472
member, typ, offset))
473473
} else {

0 commit comments

Comments
 (0)