mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 19:08:28 +00:00
Replace each_ref_ext
with each_ref
This commit is contained in:
parent
2cf1a0a3c0
commit
961d432f72
@ -1,6 +1,5 @@
|
||||
use std::{array, borrow::Borrow};
|
||||
|
||||
use fj_interop::ext::ArrayExt;
|
||||
use fj_math::{Point, Scalar};
|
||||
|
||||
use crate::{
|
||||
@ -61,7 +60,7 @@ pub trait BuildFace {
|
||||
array
|
||||
};
|
||||
let vertices = half_edges
|
||||
.each_ref_ext()
|
||||
.each_ref()
|
||||
.map(|edge: &Handle<HalfEdge>| edge.start_vertex().clone());
|
||||
|
||||
Polygon {
|
||||
|
@ -1,4 +1,3 @@
|
||||
use fj_interop::ext::ArrayExt;
|
||||
use fj_math::Point;
|
||||
use itertools::Itertools;
|
||||
|
||||
@ -63,7 +62,7 @@ impl SplitFace for Shell {
|
||||
//
|
||||
// Something to think about though!
|
||||
{
|
||||
let [(a, _), (b, _)] = line.each_ref_ext();
|
||||
let [(a, _), (b, _)] = line.each_ref();
|
||||
|
||||
let exterior = face.region().exterior();
|
||||
|
||||
|
@ -2,11 +2,6 @@
|
||||
|
||||
/// Extension trait for arrays
|
||||
pub trait ArrayExt<T, const N: usize> {
|
||||
/// Stable replacement for `each_ref`
|
||||
///
|
||||
/// <https://doc.rust-lang.org/std/primitive.array.html#method.each_ref>
|
||||
fn each_ref_ext(&self) -> [&T; N];
|
||||
|
||||
/// Stable replacement for `each_mut`
|
||||
///
|
||||
/// <https://doc.rust-lang.org/std/primitive.array.html#method.each_mut>
|
||||
@ -26,11 +21,6 @@ pub trait ArrayExt<T, const N: usize> {
|
||||
}
|
||||
|
||||
impl<T> ArrayExt<T, 2> for [T; 2] {
|
||||
fn each_ref_ext(&self) -> [&T; 2] {
|
||||
let [a, b] = self;
|
||||
[a, b]
|
||||
}
|
||||
|
||||
fn each_mut_ext(&mut self) -> [&mut T; 2] {
|
||||
let [a, b] = self;
|
||||
[a, b]
|
||||
@ -52,11 +42,6 @@ impl<T> ArrayExt<T, 2> for [T; 2] {
|
||||
}
|
||||
|
||||
impl<T> ArrayExt<T, 3> for [T; 3] {
|
||||
fn each_ref_ext(&self) -> [&T; 3] {
|
||||
let [a, b, c] = self;
|
||||
[a, b, c]
|
||||
}
|
||||
|
||||
fn each_mut_ext(&mut self) -> [&mut T; 3] {
|
||||
let [a, b, c] = self;
|
||||
[a, b, c]
|
||||
@ -78,11 +63,6 @@ impl<T> ArrayExt<T, 3> for [T; 3] {
|
||||
}
|
||||
|
||||
impl<T> ArrayExt<T, 4> for [T; 4] {
|
||||
fn each_ref_ext(&self) -> [&T; 4] {
|
||||
let [a, b, c, d] = self;
|
||||
[a, b, c, d]
|
||||
}
|
||||
|
||||
fn each_mut_ext(&mut self) -> [&mut T; 4] {
|
||||
let [a, b, c, d] = self;
|
||||
[a, b, c, d]
|
||||
|
Loading…
Reference in New Issue
Block a user