Make `Region::new` more convenient to call

This commit is contained in:
Hanno Braun 2023-05-22 11:20:38 +02:00
parent 8270f5abb2
commit afa79e48f4
2 changed files with 2 additions and 4 deletions

View File

@ -28,12 +28,12 @@ impl Region {
/// Construct an instance of `Region` /// Construct an instance of `Region`
pub fn new( pub fn new(
exterior: Handle<Cycle>, exterior: Handle<Cycle>,
interiors: Vec<Handle<Cycle>>, interiors: impl IntoIterator<Item = Handle<Cycle>>,
color: Option<Color>, color: Option<Color>,
) -> Self { ) -> Self {
Self { Self {
exterior, exterior,
interiors, interiors: interiors.into_iter().collect(),
color, color,
} }
} }

View File

@ -47,8 +47,6 @@ impl Face {
interiors: impl IntoIterator<Item = Handle<Cycle>>, interiors: impl IntoIterator<Item = Handle<Cycle>>,
color: Option<Color>, color: Option<Color>,
) -> Self { ) -> Self {
let interiors = interiors.into_iter().collect();
Self { Self {
surface, surface,
region: Region::new(exterior, interiors, color), region: Region::new(exterior, interiors, color),