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: camera.rs
    path of file: ./repos/super-mario-bros/src/libs
    
    the code of the file until where you have to start completion: use cgmath::Vector2;
use graphics::ImageSize;

use super::{player::Player, transform::Rect};

pub struct Camera {
    pub position: Vector2<f64>,
    pub viewport_width: f64,
    pub viewport_height: f64,
    pub world_width: f64,
    pub world_height: f64,
    pub scale: f64,
}

impl Camera {
    pub fn new(
        viewport_width: f64,
        viewport_height: f64,
        world_width: f64,
        world_height: f64,
        scale: f64,
    ) -> Self {
        Camera {
            position: Vector2::new(0.0, 0.0),
            viewport_width,
            viewport_height,
            world_width,
            world_height,
            scale,
        }
    }

    pub fn follow_player<I: ImageSize>(&mut self, player: &Player<I>) {
        // Calculate the camera's new position based on the p
    
    pub fn follow_player<I: ImageSize>(&mut self, player: &Player<I>) {
        // Calculate the camera's new position based on the player's position
        let target_x = player.get_transform().xw() - self.viewport_width / 2.0;
        let target_y = player.get_transform().yh() - self.viewport_height / 2.0;

        // Adjust the camera's position to stay within the game world boundaries
        if target_x < 0.0 {
            self.position.x = 0.0;
        } else if target_x + self.viewport_width > self.world_width {
            self.position.x = self.world_width - self.viewport_width;
        } else {
            self.position.x = target_x;
        }

        if target_y < 0.0 {
            self.position.y = 0.0;
        } else if target_y + self.viewport_height > self.world_height {
            self.position.y = self.world_height - self.viewport_height;
        } else {
            self.position.y = target_y;
        }
    }