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: draw_mask.rs
    path of file: ./repos/notan/examples
    
    the code of the file until where you have to start completion: use notan::draw::*;
use notan::prelude::*;

#[notan_main]
fn main() -> Result<(), String> {
    notan::init().add_config(DrawConfig).draw(draw).build()
}

fn draw(gfx: &mut Graphics) {
    // Draw a rectangle as mask
    let mut mask = gfx.create_draw();
    mask.rect((180.0, 180.0), (440.0, 240.0));

    let mut draw = gfx.create_draw();
    draw.clear(Color::BLACK);

    // Draw a triangle inside 
    
fn draw(gfx: &mut Graphics) {
    // Draw a rectangle as mask
    let mut mask = gfx.create_draw();
    mask.rect((180.0, 180.0), (440.0, 240.0));

    let mut draw = gfx.create_draw();
    draw.clear(Color::BLACK);

    // Draw a triangle inside the mask, it will be displayed trimmed by the mask rectangle
    draw.mask(Some(&mask));
    draw.triangle((400.0, 100.0), (100.0, 500.0), (700.0, 500.0))
        .color(Color::RED);

    draw.mask(None);

    // Draw a normal triangle outside the mask
    draw.triangle((400.0, 100.0), (100.0, 500.0), (700.0, 500.0))
        .color(Color::YELLOW)
        .scale(0.5, 0.5);

    gfx.render(&draw);
}