Skip to content

Commit e4d91e1

Browse files
committed
feat!: rename len to order
1 parent 9b9783b commit e4d91e1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/coordinate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl Coordinate {
1616
Ok(Self { indices })
1717
}
1818

19-
pub fn len(&self) -> usize {
19+
pub fn order(&self) -> usize {
2020
self.indices.len()
2121
}
2222

@@ -77,9 +77,9 @@ mod tests {
7777
use super::*;
7878

7979
#[test]
80-
fn test_len() {
80+
fn test_order() {
8181
let coord = coord![1, 2, 3].unwrap();
82-
assert_eq!(coord.len(), 3);
82+
assert_eq!(coord.order(), 3);
8383
}
8484

8585
#[test]

src/storage.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ impl<T> DynamicStorage<T> {
1616

1717
/// For the row-wise maths see: https://bit.ly/3KQjPa3
1818
pub fn flatten(&self, coord: &Coordinate, shape: &Shape) -> Result<usize, ShapeError> {
19-
if coord.len() != shape.order() {
20-
let msg = format!("incorrect order ({} vs {}).", coord.len(), shape.order());
19+
if coord.order() != shape.order() {
20+
let msg = format!("incorrect order ({} vs {}).", coord.order(), shape.order());
2121
return Err(ShapeError::new(msg.as_str()));
2222
}
2323

0 commit comments

Comments
 (0)