Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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