gw-rust-programming-tutorial 0.1.0

gw rust test.
Documentation
use std::fs;
use std::error::Error;

pub fn test_file()
{
    if let Err(e) = test_file_read()
    {
        println!("err={}",e);
    }
}

fn test_file_read()->Result<(),Box<dyn Error>>
{
    //使用?表示 如果函数发生错误返回error给调用者去处理
    let content = fs::read_to_string("c:\\2.txt")?;

    println!( "file content = {}" ,content);
    Ok(())
}