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`
pub fn new(
exterior: Handle<Cycle>,
interiors: Vec<Handle<Cycle>>,
interiors: impl IntoIterator<Item = Handle<Cycle>>,
color: Option<Color>,
) -> Self {
Self {
exterior,
interiors,
interiors: interiors.into_iter().collect(),
color,
}
}

View File

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