Skip to content

Commit

Permalink
Update to work with latest Rust master.
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntSushi committed Oct 9, 2014
1 parent 067799a commit 2f70641
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/bytestr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl fmt::Show for ByteString {
}
}

impl Slice<u8> for ByteString {
impl AsSlice<u8> for ByteString {
#[inline]
fn as_slice<'a>(&'a self) -> &'a [u8] {
let ByteString(ref chars) = *self;
Expand All @@ -81,18 +81,18 @@ impl ops::Slice<uint, [u8]> for ByteString {
}

#[inline]
fn slice_from_<'a>(&'a self, start: &uint) -> &'a [u8] {
self.as_slice().slice_from_(start)
fn slice_from_or_fail<'a>(&'a self, start: &uint) -> &'a [u8] {
self.as_slice().slice_from_or_fail(start)
}

#[inline]
fn slice_to_<'a>(&'a self, end: &uint) -> &'a [u8] {
self.as_slice().slice_to_(end)
fn slice_to_or_fail<'a>(&'a self, end: &uint) -> &'a [u8] {
self.as_slice().slice_to_or_fail(end)
}

#[inline]
fn slice_<'a>(&'a self, start: &uint, end: &uint) -> &'a [u8] {
self.as_slice().slice_(start, end)
fn slice_or_fail<'a>(&'a self, start: &uint, end: &uint) -> &'a [u8] {
self.as_slice().slice_or_fail(start, end)
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#![experimental]
#![deny(missing_doc)]

#![feature(default_type_params, slicing_syntax)]

//! This crate provides a streaming CSV (comma separated values) writer and
//! reader that works with the `serialize` crate to do type based encoding
//! and decoding. There are two primary goals of this project:
Expand Down Expand Up @@ -184,8 +186,6 @@
//! general, the writer and reader API biases toward using Unicode strings
//! while providing an outlet to use byte strings.
#![feature(default_type_params, phase)]

extern crate rand;
extern crate serialize;
extern crate "test" as stdtest;
Expand Down
4 changes: 2 additions & 2 deletions src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl<W: io::Writer> Writer<W> {
///
/// assert_eq!(wtr.as_bytes(), b"\xff,\x00\n");
/// ```
pub fn write_bytes<S: Slice<u8>, I: Iterator<S>>
pub fn write_bytes<S: AsSlice<u8>, I: Iterator<S>>
(&mut self, r: I) -> CsvResult<()> {
let mut count = 0;
let delim = self.delimiter;
Expand All @@ -205,7 +205,7 @@ impl<W: io::Writer> Writer<W> {
}

#[doc(hidden)]
pub fn write_results<S: Slice<u8>, I: Iterator<CsvResult<S>>>
pub fn write_results<S: AsSlice<u8>, I: Iterator<CsvResult<S>>>
(&mut self, r: I) -> CsvResult<()> {
let mut count = 0;
let delim = self.delimiter;
Expand Down

0 comments on commit 2f70641

Please sign in to comment.