From 26fb2e652cc124ddb5e9380fde1d863658bd5e41 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 24 Mar 2017 21:22:11 +0700 Subject: [PATCH] Rename `to_uint` to `to_usize`. The naming was a historical artifact and since the types involved as `usize`, the name can match. Fixes #180. --- src/point.rs | 6 +++--- src/rect.rs | 2 +- src/size.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/point.rs b/src/point.rs index 205ef66..285b5aa 100644 --- a/src/point.rs +++ b/src/point.rs @@ -244,7 +244,7 @@ impl TypedPoint2D { /// When casting from floating point points, it is worth considering whether /// to `round()`, `ceil()` or `floor()` before the cast in order to obtain /// the desired conversion behavior. - pub fn to_uint(&self) -> TypedPoint2D { + pub fn to_usize(&self) -> TypedPoint2D { self.cast().unwrap() } @@ -481,7 +481,7 @@ impl TypedPoint3D { /// When casting from floating point points, it is worth considering whether /// to `round()`, `ceil()` or `floor()` before the cast in order to obtain /// the desired conversion behavior. - pub fn to_uint(&self) -> TypedPoint3D { + pub fn to_usize(&self) -> TypedPoint3D { self.cast().unwrap() } @@ -720,7 +720,7 @@ impl TypedPoint4D { /// When casting from floating point points, it is worth considering whether /// to `round()`, `ceil()` or `floor()` before the cast in order to obtain /// the desired conversion behavior. - pub fn to_uint(&self) -> TypedPoint4D { + pub fn to_usize(&self) -> TypedPoint4D { self.cast().unwrap() } diff --git a/src/rect.rs b/src/rect.rs index 835c1b5..6d759b1 100644 --- a/src/rect.rs +++ b/src/rect.rs @@ -404,7 +404,7 @@ impl TypedRect { /// When casting from floating point rectangles, it is worth considering whether /// to `round()`, `round_in()` or `round_out()` before the cast in order to /// obtain the desired conversion behavior. - pub fn to_uint(&self) -> TypedRect { + pub fn to_usize(&self) -> TypedRect { self.cast().unwrap() } diff --git a/src/size.rs b/src/size.rs index 3b5288f..0a97e4a 100644 --- a/src/size.rs +++ b/src/size.rs @@ -204,7 +204,7 @@ impl TypedSize2D { /// When casting from floating point sizes, it is worth considering whether /// to `round()`, `ceil()` or `floor()` before the cast in order to obtain /// the desired conversion behavior. - pub fn to_uint(&self) -> TypedSize2D { + pub fn to_usize(&self) -> TypedSize2D { self.cast().unwrap() }