Skip to content

Commit f6a933b

Browse files
committed
Rename get_dimension_info to dimension_info
1 parent d988fc2 commit f6a933b

3 files changed

Lines changed: 17 additions & 18 deletions

File tree

lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,10 @@ impl InnerPostgresConnection {
514514
};
515515

516516
let result_desc = match self.read_message() {
517-
RowDescription { descriptions } => {
517+
RowDescription { descriptions } =>
518518
descriptions.move_iter().map(|desc| {
519519
ResultDescription::from_row_description_entry(desc)
520-
}).collect()
521-
}
520+
}).collect(),
522521
NoData => ~[],
523522
_ => unreachable!()
524523
};

types/array.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct DimensionInfo {
1515
/// Specifies methods that can be performed on multi-dimensional arrays
1616
pub trait Array<T> {
1717
/// Returns information about the dimensions of this array
18-
fn get_dimension_info<'a>(&'a self) -> &'a [DimensionInfo];
18+
fn dimension_info<'a>(&'a self) -> &'a [DimensionInfo];
1919

2020
/// Slices into this array, returning an immutable view of a subarray.
2121
///
@@ -57,9 +57,9 @@ pub trait MutableArray<T> : Array<T> {
5757

5858
trait InternalArray<T> : Array<T> {
5959
fn shift_idx(&self, idx: int) -> uint {
60-
let shifted_idx = idx - self.get_dimension_info()[0].lower_bound;
60+
let shifted_idx = idx - self.dimension_info()[0].lower_bound;
6161
assert!(shifted_idx >= 0 &&
62-
shifted_idx < self.get_dimension_info()[0].len as int,
62+
shifted_idx < self.dimension_info()[0].len as int,
6363
"Out of bounds array access");
6464
shifted_idx as uint
6565
}
@@ -149,7 +149,7 @@ impl<T> ArrayBase<T> {
149149
}
150150

151151
impl<T> Array<T> for ArrayBase<T> {
152-
fn get_dimension_info<'a>(&'a self) -> &'a [DimensionInfo] {
152+
fn dimension_info<'a>(&'a self) -> &'a [DimensionInfo] {
153153
self.info.as_slice()
154154
}
155155

@@ -189,16 +189,16 @@ pub struct ArraySlice<'parent, T> {
189189
}
190190

191191
impl<'parent, T> Array<T> for ArraySlice<'parent, T> {
192-
fn get_dimension_info<'a>(&'a self) -> &'a [DimensionInfo] {
192+
fn dimension_info<'a>(&'a self) -> &'a [DimensionInfo] {
193193
let info = match self.parent {
194-
SliceParent(p) => p.get_dimension_info(),
195-
BaseParent(p) => p.get_dimension_info()
194+
SliceParent(p) => p.dimension_info(),
195+
BaseParent(p) => p.dimension_info()
196196
};
197197
info.slice_from(1)
198198
}
199199

200200
fn slice<'a>(&'a self, idx: int) -> ArraySlice<'a, T> {
201-
assert!(self.get_dimension_info().len() != 1,
201+
assert!(self.dimension_info().len() != 1,
202202
"Attempted to slice a one-dimensional array");
203203
ArraySlice {
204204
parent: SliceParent(self),
@@ -207,15 +207,15 @@ impl<'parent, T> Array<T> for ArraySlice<'parent, T> {
207207
}
208208

209209
fn get<'a>(&'a self, idx: int) -> &'a T {
210-
assert!(self.get_dimension_info().len() == 1,
210+
assert!(self.dimension_info().len() == 1,
211211
"Attempted to get from a multi-dimensional array");
212212
self.raw_get(self.shift_idx(idx), 1)
213213
}
214214
}
215215

216216
impl<'parent, T> InternalArray<T> for ArraySlice<'parent, T> {
217217
fn raw_get<'a>(&'a self, idx: uint, size: uint) -> &'a T {
218-
let size = size * self.get_dimension_info()[0].len;
218+
let size = size * self.dimension_info()[0].len;
219219
let idx = size * self.idx + idx;
220220
match self.parent {
221221
SliceParent(p) => p.raw_get(idx, size),
@@ -230,8 +230,8 @@ pub struct MutArraySlice<'parent, T> {
230230
}
231231

232232
impl<'parent, T> Array<T> for MutArraySlice<'parent, T> {
233-
fn get_dimension_info<'a>(&'a self) -> &'a [DimensionInfo] {
234-
self.slice.get_dimension_info()
233+
fn dimension_info<'a>(&'a self) -> &'a [DimensionInfo] {
234+
self.slice.dimension_info()
235235
}
236236

237237
fn slice<'a>(&'a self, idx: int) -> ArraySlice<'a, T> {
@@ -253,7 +253,7 @@ mod tests {
253253
fn test_from_vec() {
254254
let a = ArrayBase::from_vec(~[0, 1, 2], -1);
255255
assert_eq!([DimensionInfo { len: 3, lower_bound: -1 }],
256-
a.get_dimension_info());
256+
a.dimension_info());
257257
assert_eq!(&0, a.get(-1));
258258
assert_eq!(&1, a.get(0));
259259
assert_eq!(&2, a.get(1));

types/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,11 @@ macro_rules! to_array_impl(
598598
check_types!($($oid)|+, ty)
599599
let mut buf = MemWriter::new();
600600

601-
buf.write_be_i32(self.get_dimension_info().len() as i32);
601+
buf.write_be_i32(self.dimension_info().len() as i32);
602602
buf.write_be_i32(1);
603603
buf.write_be_i32($base_oid);
604604

605-
for info in self.get_dimension_info().iter() {
605+
for info in self.dimension_info().iter() {
606606
buf.write_be_i32(info.len as i32);
607607
buf.write_be_i32(info.lower_bound as i32);
608608
}

0 commit comments

Comments
 (0)