From 131fa11b5aa1325618c9c259fcce1456c6500389 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 6 Dec 2014 10:08:28 -0800 Subject: [PATCH] Remove remaining [] usage --- src/error.rs | 4 ++-- src/types/array.rs | 2 +- src/types/uuid.rs | 2 +- src/util.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/error.rs b/src/error.rs index 0e1f950a..e0770a94 100644 --- a/src/error.rs +++ b/src/error.rs @@ -529,12 +529,12 @@ impl DbError { let mut map: HashMap<_, _> = fields.into_iter().collect(); Ok(DbError { severity: try!(map.remove(&b'S').ok_or(())), - code: SqlState::from_code(try!(map.remove(&b'C').ok_or(()))[]), + code: SqlState::from_code(&*try!(map.remove(&b'C').ok_or(()))), message: try!(map.remove(&b'M').ok_or(())), detail: map.remove(&b'D'), hint: map.remove(&b'H'), position: match map.remove(&b'P') { - Some(pos) => Some(ErrorPosition::Normal(try!(from_str(pos[]).ok_or(())))), + Some(pos) => Some(ErrorPosition::Normal(try!(from_str(&*pos).ok_or(())))), None => match map.remove(&b'p') { Some(pos) => Some(ErrorPosition::Internal { position: try!(from_str(pos[]).ok_or(())), diff --git a/src/types/array.rs b/src/types/array.rs index 44e78bdb..25cc1fe3 100644 --- a/src/types/array.rs +++ b/src/types/array.rs @@ -155,7 +155,7 @@ impl ArrayBase { impl Array for ArrayBase { fn dimension_info<'a>(&'a self) -> &'a [DimensionInfo] { - self.info[] + &*self.info } fn slice<'a>(&'a self, idx: int) -> ArraySlice<'a, T> { diff --git a/src/types/uuid.rs b/src/types/uuid.rs index b41050df..fb9c576a 100644 --- a/src/types/uuid.rs +++ b/src/types/uuid.rs @@ -7,7 +7,7 @@ use Result; impl RawFromSql for Uuid { fn raw_from_sql(raw: &mut R) -> Result { - match Uuid::from_bytes(try!(raw.read_to_end())[]) { + match Uuid::from_bytes(&*try!(raw.read_to_end())) { Some(u) => Ok(u), None => Err(Error::BadData), } diff --git a/src/util.rs b/src/util.rs index bc73a017..ea59acdb 100644 --- a/src/util.rs +++ b/src/util.rs @@ -14,6 +14,6 @@ pub fn comma_join<'a, W, I>(writer: &mut W, mut strs: I) -> IoResult<()> } pub fn parse_update_count(tag: String) -> uint { - let s = tag[].split(' ').last().unwrap(); + let s = tag.split(' ').last().unwrap(); from_str(s).unwrap_or(0) }