From c185c0cd38062420e6fe2fc1e4391d309f526ddf Mon Sep 17 00:00:00 2001 From: Mathijs van de Nes Date: Tue, 31 Mar 2015 09:54:09 +0200 Subject: [PATCH] Replace usage of range{,_step}_inclusive --- src/cp437.rs | 4 ++-- src/lib.rs | 2 +- src/spec.rs | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cp437.rs b/src/cp437.rs index 8e8761b5..4f4fc663 100644 --- a/src/cp437.rs +++ b/src/cp437.rs @@ -149,9 +149,9 @@ mod test #[test] fn to_char_valid() { - for i in ::std::iter::range_inclusive(0x00, 0xFF) + for i in 0x00_u32 .. 0x100 { - super::to_char(i); + super::to_char(i as u8); } } } diff --git a/src/lib.rs b/src/lib.rs index cc79121d..e9746ca1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,7 @@ #![feature(unsafe_destructor)] #![warn(missing_docs)] -#![feature(core, io, into_cow)] +#![feature(io, into_cow, step_by)] extern crate time; extern crate flate2; diff --git a/src/spec.rs b/src/spec.rs index 2de74f77..eff1e818 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -1,7 +1,6 @@ use std::io; use std::io::prelude::*; use result::{ZipResult, ZipError}; -use std::iter::range_step_inclusive; use podio::{ReadPodExt, WritePodExt, LittleEndian}; pub static LOCAL_FILE_HEADER_SIGNATURE : u32 = 0x04034b50; @@ -56,7 +55,7 @@ impl CentralDirectoryEnd let file_length = try!(reader.seek(io::SeekFrom::End(0))) as i64; let search_upper_bound = ::std::cmp::max(0, file_length - header_size - ::std::u16::MAX as i64); - for pos in range_step_inclusive(file_length - header_size, search_upper_bound, -1) + for pos in (file_length - header_size .. search_upper_bound - 1).step_by(-1) { try!(reader.seek(io::SeekFrom::Start(pos as u64))); if try!(reader.read_u32::()) == CENTRAL_DIRECTORY_END_SIGNATURE