Skip to content

Commit

Permalink
fix test fallout
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Burka committed Nov 3, 2018
1 parent d5e3e8a commit 706a1cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/test/run-pass/impl-trait/example-calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ trait IteratorExt: Iterator + Sized {
where Self::Item: std::fmt::Display {
let mut s = String::new();
if let Some(e) = self.next() {
write!(s, "{}", e);
write!(s, "{}", e).unwrap();
for e in self {
s.push_str(sep);
write!(s, "{}", e);
write!(s, "{}", e).unwrap();
}
}
s
Expand Down Expand Up @@ -537,7 +537,7 @@ fn format_weeks(it: impl Iterator<Item = impl DateIterator>) -> impl Iterator<It
first = false;
}

write!(buf, " {:>2}", d.day());
write!(buf, " {:>2}", d.day()).unwrap();
}

// Insert more filler at the end to fill up the remainder of the week,
Expand Down
8 changes: 4 additions & 4 deletions src/test/run-pass/macros/colorful-write-macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ impl fmt::Write for Bar {
}

fn borrowing_writer_from_struct_and_formatting_struct_field(foo: Foo) {
write!(foo.writer, "{}", foo.other);
write!(foo.writer, "{}", foo.other).unwrap();
}

fn main() {
let mut w = Vec::new();
write!(&mut w as &mut Write, "");
write!(&mut w, ""); // should coerce
write!(&mut w as &mut Write, "").unwrap();
write!(&mut w, "").unwrap(); // should coerce
println!("ok");

let mut s = Bar;
{
use std::fmt::Write;
write!(&mut s, "test");
write!(&mut s, "test").unwrap();
}
}

0 comments on commit 706a1cc

Please sign in to comment.