mirror of
https://github.com/Hopiu/lychee.git
synced 2026-04-01 20:20:32 +00:00
Directly connect into Result
This commit is contained in:
parent
59abd189cf
commit
4b537763a5
1 changed files with 4 additions and 7 deletions
|
|
@ -118,13 +118,10 @@ fn run_main() -> Result<i32> {
|
|||
|
||||
// Load excludes from file
|
||||
for path in &opts.config.exclude_file {
|
||||
let file = File::open(path).expect("No such file");
|
||||
opts.config.exclude.append(
|
||||
&mut io::BufReader::new(file)
|
||||
.lines()
|
||||
.map(|l| l.expect("Could not read line"))
|
||||
.collect(),
|
||||
);
|
||||
let file = File::open(path)?;
|
||||
opts.config
|
||||
.exclude
|
||||
.append(&mut io::BufReader::new(file).lines().collect::<Result<_, _>>()?);
|
||||
}
|
||||
|
||||
let cfg = &opts.config;
|
||||
|
|
|
|||
Loading…
Reference in a new issue