wherr 0.1.7

Enhance Rust errors with file and line details using the `#[wherr]` macro for clearer debugging.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
fn concat_files(path1: &str, path2: &str) -> Result<String, std::io::Error> {
    let mut content1 = std::fs::read_to_string(path1)?;
    let content2 = std::fs::read_to_string(path2)?;

    content1.push_str(&content2);
    Ok(content1)
}

fn main() {
    let content = concat_files("file1.txt", "file2.txt").expect("Failed to concatenate the files");
    println!("Concatenated content:\n{content}");
}