Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2403f82

Browse files
ytmimicalebcartwright
authored andcommitted
Add test case for issue 1306 which was resolved
Closes 1306 It's unclear when the issue was fixed, but it cannot be reproduced.
1 parent 35f4c55 commit 2403f82

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

tests/source/issue_1306.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// rustfmt-max_width: 160
2+
// rustfmt-fn_call_width: 96
3+
// rustfmt-fn_args_layout: Compressed
4+
// rustfmt-trailing_comma: Always
5+
// rustfmt-wrap_comments: true
6+
7+
fn foo() {
8+
for elem in try!(gen_epub_book::ops::parse_descriptor_file(&mut try!(File::open(&opts.source_file.1).map_err(|_| {
9+
gen_epub_book::Error::Io {
10+
desc: "input file",
11+
op: "open",
12+
more: None,
13+
}
14+
})),
15+
"input file")) {
16+
println!("{}", elem);
17+
}
18+
}
19+
20+
fn write_content() {
21+
io::copy(try!(File::open(in_f).map_err(|_| {
22+
Error::Io {
23+
desc: "Content",
24+
op: "open",
25+
more: None,
26+
}
27+
})),
28+
w);
29+
}

tests/target/issue_1306.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// rustfmt-max_width: 160
2+
// rustfmt-fn_call_width: 96
3+
// rustfmt-fn_args_layout: Compressed
4+
// rustfmt-trailing_comma: Always
5+
// rustfmt-wrap_comments: true
6+
7+
fn foo() {
8+
for elem in try!(gen_epub_book::ops::parse_descriptor_file(
9+
&mut try!(File::open(&opts.source_file.1).map_err(|_| {
10+
gen_epub_book::Error::Io {
11+
desc: "input file",
12+
op: "open",
13+
more: None,
14+
}
15+
})),
16+
"input file"
17+
)) {
18+
println!("{}", elem);
19+
}
20+
}
21+
22+
fn write_content() {
23+
io::copy(
24+
try!(File::open(in_f).map_err(|_| {
25+
Error::Io {
26+
desc: "Content",
27+
op: "open",
28+
more: None,
29+
}
30+
})),
31+
w,
32+
);
33+
}

0 commit comments

Comments
 (0)