[][src]Function tao_of_rust::ch02::answer

pub fn answer()

answer

Basic usage:

// extern crate std;      // 声明语句
// use std::prelude::v1::*;  // 声明语句

pub fn answer() -> (){
    let a = 40;  // 声明语句
    let b = 2;   // 声明语句
    assert_eq!(sum(a, b), 42); // 宏语句
}

pub fn sum(a: i32, b: i32) -> i32 {
    a + b  // 表达式
}

answer(); // 表达式语句Run