You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: rectangle.rs
    path of file: ./repos/kiomet/common/src/tower
    
    the code of the file until where you have to start completion: // SPDX-FileCopyrightText: 2023 Softbear, Inc.
// SPDX-License-Identifier: AGPL-3.0-or-later

use crate::chunk::ChunkRectangle;
use crate::tower::TowerId;
use crate::world::WorldChunks;
use common_util::x_vec2::U16Vec2;
use core_protocol::prelude::*;
use diff::
    
    pub fn bounding<I: IntoIterator<Item = TowerId>>(tower_ids: I) -> Self {
        let mut ret = Self {
            bottom_left: TowerId::new(u16::MAX, u16::MAX),
            top_right: TowerId::new(0, 0),
        };

        debug_assert!(!ret.is_valid());

        for tower_id in tower_ids.into_iter() {
            ret.bottom_left.x = ret.bottom_left.x.min(tower_id.x);
            ret.bottom_left.y = ret.bottom_left.y.min(tower_id.y);
            ret.top_right.x = ret.top_right.x.max(tower_id.x);
            ret.top_right.y = ret.top_right.y.max(tower_id.y);
            debug_assert!(ret.is_valid());
            debug_assert!(ret.contains(tower_id));
        }

        ret
    }