From 8c3d0b3fc7cd430b4b8bb91e9e71922404ce5040 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 2 Jun 2021 13:03:58 -0400 Subject: kd, vp: Use as_deref() --- src/kd.rs | 5 ++--- src/vp.rs | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/kd.rs b/src/kd.rs index bf6b7c6..49b7711 100644 --- a/src/kd.rs +++ b/src/kd.rs @@ -9,7 +9,6 @@ use crate::util::Ordered; use num_traits::Signed; use std::iter::FromIterator; -use std::ops::Deref; /// A node in a k-d tree. #[derive(Debug)] @@ -158,11 +157,11 @@ where } fn left(self) -> Option { - self.left.as_ref().map(Box::deref) + self.left.as_deref() } fn right(self) -> Option { - self.right.as_ref().map(Box::deref) + self.right.as_deref() } } diff --git a/src/vp.rs b/src/vp.rs index a5859ae..965f484 100644 --- a/src/vp.rs +++ b/src/vp.rs @@ -8,7 +8,6 @@ use num_traits::zero; use std::fmt::{self, Debug, Formatter}; use std::iter::{Extend, FromIterator}; -use std::ops::Deref; /// A node in a VP tree. #[derive(Debug)] @@ -171,11 +170,11 @@ where } fn inside(self) -> Option { - self.inside.as_ref().map(Box::deref) + self.inside.as_deref() } fn outside(self) -> Option { - self.outside.as_ref().map(Box::deref) + self.outside.as_deref() } } -- cgit v1.2.3