Skip to content

Commit 84b4fc5

Browse files
author
Rory McCann
committed
Translate doesn't have to be Float
1 parent d4ad7ef commit 84b4fc5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/algorithm/translate.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use num_traits::Float;
1+
use types::CoordinateType;
22
use algorithm::map_coords::{MapCoords, MapCoordsInplace};
33

44
pub trait Translate<T> {
@@ -22,14 +22,14 @@ pub trait Translate<T> {
2222
/// let correct_ls = LineString(correct);
2323
/// assert_eq!(translated, correct_ls);
2424
/// ```
25-
fn translate(&self, xoff: T, yoff: T) -> Self where T: Float;
25+
fn translate(&self, xoff: T, yoff: T) -> Self where T: CoordinateType;
2626

2727
/// Translate a Geometry along its axes, but in place.
28-
fn translate_inplace(&mut self, xoff: T, yoff: T) where T: Float;
28+
fn translate_inplace(&mut self, xoff: T, yoff: T) where T: CoordinateType;
2929
}
3030

3131
impl<T, G> Translate<T> for G
32-
where T: Float,
32+
where T: CoordinateType,
3333
G: MapCoords<T, T, Output=G>+MapCoordsInplace<T>
3434
{
3535
fn translate(&self, xoff: T, yoff: T) -> Self {

0 commit comments

Comments
 (0)