Skip to content

Commit

Permalink
base: Use use core::ops; in face.rs.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed Jun 1, 2024
1 parent 0a48306 commit 1a2b646
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions all-is-cubes-base/src/math/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! This module is private but reexported by its parent.
use core::fmt;
use core::ops::{Index, IndexMut};
use core::ops;

use euclid::Vector3D;

Expand Down Expand Up @@ -211,7 +211,7 @@ impl Face6 {
#[must_use]
pub fn normal_vector<S, U>(self) -> Vector3D<S, U>
where
S: Zero + num_traits::One + core::ops::Neg<Output = S>,
S: Zero + num_traits::One + ops::Neg<Output = S>,
{
self.into7().normal_vector()
}
Expand All @@ -232,7 +232,7 @@ impl Face6 {
#[must_use]
pub fn dot<S, U>(self, vector: Vector3D<S, U>) -> S
where
S: Zero + core::ops::Neg<Output = S>,
S: Zero + ops::Neg<Output = S>,
{
self.into7().dot(vector)
}
Expand Down Expand Up @@ -440,7 +440,7 @@ impl Face7 {
#[must_use]
pub fn normal_vector<S, U>(self) -> Vector3D<S, U>
where
S: Zero + num_traits::One + core::ops::Neg<Output = S>,
S: Zero + num_traits::One + ops::Neg<Output = S>,
{
match self {
Face7::Within => Vector3D::new(S::zero(), S::zero(), S::zero()),
Expand Down Expand Up @@ -469,7 +469,7 @@ impl Face7 {
#[must_use]
pub fn dot<S, U>(self, vector: Vector3D<S, U>) -> S
where
S: Zero + core::ops::Neg<Output = S>,
S: Zero + ops::Neg<Output = S>,
{
match self {
Face7::Within => S::zero(),
Expand Down Expand Up @@ -807,7 +807,7 @@ impl<V: Copy> FaceMap<V> {
}
}

impl<V> Index<Face6> for FaceMap<V> {
impl<V> ops::Index<Face6> for FaceMap<V> {
type Output = V;
#[inline]
fn index(&self, face: Face6) -> &V {
Expand All @@ -822,7 +822,7 @@ impl<V> Index<Face6> for FaceMap<V> {
}
}

impl<V> IndexMut<Face6> for FaceMap<V> {
impl<V> ops::IndexMut<Face6> for FaceMap<V> {
#[inline]
fn index_mut(&mut self, face: Face6) -> &mut V {
match face {
Expand Down

0 comments on commit 1a2b646

Please sign in to comment.