From 19542747001f60592343da68c3ea067eda6ecfd7 Mon Sep 17 00:00:00 2001 From: Keunwoo Lee Date: Sun, 25 Jan 2015 00:17:38 -0800 Subject: [PATCH] od: fix warnings --- src/od/od.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/od/od.rs b/src/od/od.rs index 692485358..5a290ecea 100644 --- a/src/od/od.rs +++ b/src/od/od.rs @@ -1,4 +1,5 @@ #![crate_name = "od"] +#![allow(unstable)] /* * This file is part of the uutils coreutils package. @@ -15,7 +16,7 @@ extern crate collections; use collections::string::String; use std::io::File; -#[deriving(Show)] +#[derive(Show)] enum Radix { Decimal, Hexadecimal, Octal, Binary } pub fn uumain(args: Vec) -> isize { @@ -81,7 +82,7 @@ fn main(radix: Radix, fname: String) { }, Radix::Octal => { for b in range(0, n/std::u16::BYTES) { - let bs = bytes.slice(2*b, 2*b+2); + let bs = &bytes[2*b .. 2*b+2]; let p: u16 = (bs[1] as u16) << 8 | bs[0] as u16; print!(" {:06o}", p); }