Fix clippy warnings

This commit is contained in:
Alexandre Bury 2017-04-23 15:16:39 -07:00
parent 22a9725f8e
commit d4f1439abd
2 changed files with 3 additions and 2 deletions

View File

@ -537,7 +537,7 @@ impl Cursive {
// Reference it or something // Reference it or something
let sizes = self.screen().layer_sizes(); let sizes = self.screen().layer_sizes();
if &self.last_sizes != &sizes { if self.last_sizes != sizes {
self.clear(); self.clear();
self.last_sizes = sizes; self.last_sizes = sizes;
} }

View File

@ -29,7 +29,8 @@ pub fn read_char<F>(first: u8, next: F) -> Result<char, String>
// We already have one byte, now read the others. // We already have one byte, now read the others.
for _ in 1..n_bytes { for _ in 1..n_bytes {
let byte = try!(next().ok_or("Missing UTF-8 byte".to_string())); let byte =
try!(next().ok_or_else(|| "Missing UTF-8 byte".to_string()));
if byte & 0xC0 != 0x80 { if byte & 0xC0 != 0x80 {
return Err(format!("Found non-continuation byte after leading: \ return Err(format!("Found non-continuation byte after leading: \
{}", {}",