1. error[E0599]: no method named `lines` found for enum `std::result::Result<std::string::String, std::io::Error>` in the current scope
    2. --> src\main.rs:20:25
    3. |
    4. | ^^^^^ method not found in `std::result::Result<std::string::String, std::io::Error>`
    5. error: aborting due to previous error
    6. For more information about this error, try `rustc --explain E0599`.

    你的输出或者输出,存在未处理的情况。如:

    • 读文件,存在文件不可读的情况
    • 转化u32, 存在不能转换的情况
    • 读参数,存在参数没有的情况

    expect 解决:

    1. let content = std::fs::read_to_string(&args.path).expect("could not read file");
    2. let pattern = std::env::args().nth(1).expect("no pattern given");