Skip to content

Commit

Permalink
Merge pull request #134 from mgeisler/write-use
Browse files Browse the repository at this point in the history
Import `Write` just once
  • Loading branch information
mgeisler authored Sep 9, 2023
2 parents fc7f163 + 6666d00 commit 9b90f1e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/contains_regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ pub fn check_only_contains_regex(
#[cfg(test)]
mod tests {
use super::*;
use std::io::Write;

#[test]
fn bad_regex() {
Expand Down Expand Up @@ -227,7 +228,6 @@ mod tests {
// (https://github.com/rust-lang/regex/issues/244), so
// version-sync makes sure to normalize \r\n to \n when
// reading files.
use std::io::Write;
let mut file = tempfile::NamedTempFile::new().unwrap();

file.write_all(b"first line\r\nsecond line\r\nthird line\r\n")
Expand Down Expand Up @@ -255,7 +255,6 @@ mod tests {

#[test]
fn only_contains_success() {
use std::io::Write;
let mut file = tempfile::NamedTempFile::new().unwrap();
file.write_all(
b"first: docs.rs/foo/1.2.3/foo/fn.bar.html
Expand All @@ -276,7 +275,6 @@ mod tests {

#[test]
fn only_contains_success_compatible() {
use std::io::Write;
let mut file = tempfile::NamedTempFile::new().unwrap();
file.write_all(
b"first: docs.rs/foo/1.2/foo/fn.bar.html
Expand All @@ -297,7 +295,6 @@ mod tests {

#[test]
fn only_contains_failure() {
use std::io::Write;
let mut file = tempfile::NamedTempFile::new().unwrap();
file.write_all(
b"first: docs.rs/foo/1.0.0/foo/ <- error
Expand All @@ -319,7 +316,6 @@ mod tests {

#[test]
fn only_contains_fails_if_no_match() {
use std::io::Write;
let mut file = tempfile::NamedTempFile::new().unwrap();
file.write_all(b"not a match").unwrap();

Expand Down

0 comments on commit 9b90f1e

Please sign in to comment.