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

Commit bb0efb0

Browse files
author
Jonathan Creekmore
committed
correct clippy issues in test code
1 parent e209947 commit bb0efb0

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ script:
1010

1111
matrix:
1212
include:
13-
- rust: 1.31.1
13+
- rust: 1.38.0
1414
env: CLIPPY=YESPLEASE
1515
before_script: rustup component add clippy-preview
1616
script: cargo clippy --all-targets --all -- -D warnings
17-
- rust: 1.31.1
17+
- rust: 1.38.0
1818
env: RUSTFMT=YESPLEASE
1919
before_script: rustup component add rustfmt-preview
2020
script: cargo fmt --all -- --check

src/human.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,13 @@ mod test_helper {
269269
pub fn target(&self) -> Target {
270270
Target::human(self.formatter())
271271
}
272+
}
272273

273-
pub fn to_string(&self) -> String {
274+
impl ::std::fmt::Display for TestTarget {
275+
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
274276
let target = self.buffer.0.clone();
275277
let buffer = target.read().unwrap();
276-
String::from_utf8_lossy(buffer.as_slice()).to_string()
278+
write!(f, "{}", String::from_utf8_lossy(buffer.as_slice()))
277279
}
278280
}
279281
}

src/json.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,13 @@ mod test_helper {
279279
pub fn target(&self) -> Target {
280280
Target::json(self.formatter())
281281
}
282+
}
282283

283-
pub fn to_string(&self) -> String {
284+
impl ::std::fmt::Display for TestTarget {
285+
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
284286
let target = self.buffer.0.clone();
285287
let buffer = target.read().unwrap();
286-
String::from_utf8_lossy(buffer.as_slice()).to_string()
288+
write!(f, "{}", String::from_utf8_lossy(buffer.as_slice()))
287289
}
288290
}
289291
}

0 commit comments

Comments
 (0)