Rust: return in match

rust allows the function to return in match, even if other arms are returning a value to local variable.

use std::io::prelude::*;

fn main() {
    println!("{}", ff());
}

fn ff() -> u32 {
    let a = ff1();
    let b = match a {
        1 => 100,
        2 => 200,
        3 => return 300,
        _ => panic!("wtf!"),
    };

    return b + 1;
}

fn ff1() -> u32 {
    3
}

This code outputs 300.