From 0cc439eee3fe0b46cdf5895787138c336e7b191f Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 24 Feb 2024 12:04:57 -0800 Subject: [PATCH] Fix redundant imports. --- src/book/book.rs | 1 - src/book/mod.rs | 3 +-- src/book/summary.rs | 1 - src/cmd/test.rs | 2 +- src/config.rs | 2 +- src/theme/mod.rs | 1 - src/utils/fs.rs | 1 - 7 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/book/book.rs b/src/book/book.rs index 96c70abc..39d58aed 100644 --- a/src/book/book.rs +++ b/src/book/book.rs @@ -339,7 +339,6 @@ impl Display for Chapter { #[cfg(test)] mod tests { use super::*; - use std::io::Write; use tempfile::{Builder as TempFileBuilder, TempDir}; const DUMMY_SRC: &str = " diff --git a/src/book/mod.rs b/src/book/mod.rs index a5e3e78c..166f6511 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -18,7 +18,6 @@ use log::{debug, error, info, log_enabled, trace, warn}; use std::io::Write; use std::path::PathBuf; use std::process::Command; -use std::string::ToString; use tempfile::Builder as TempFileBuilder; use toml::Value; use topological_sort::TopologicalSort; @@ -605,7 +604,7 @@ fn preprocessor_should_run( mod tests { use super::*; use std::str::FromStr; - use toml::value::{Table, Value}; + use toml::value::Table; #[test] fn config_defaults_to_html_renderer_if_empty() { diff --git a/src/book/summary.rs b/src/book/summary.rs index ed8f8337..5ac22b98 100644 --- a/src/book/summary.rs +++ b/src/book/summary.rs @@ -4,7 +4,6 @@ use memchr::Memchr; use pulldown_cmark::{DefaultBrokenLinkCallback, Event, HeadingLevel, Tag, TagEnd}; use serde::{Deserialize, Serialize}; use std::fmt::{self, Display, Formatter}; -use std::iter::FromIterator; use std::ops::{Deref, DerefMut}; use std::path::{Path, PathBuf}; diff --git a/src/cmd/test.rs b/src/cmd/test.rs index 69f99f40..d41e9ef9 100644 --- a/src/cmd/test.rs +++ b/src/cmd/test.rs @@ -1,7 +1,7 @@ use super::command_prelude::*; use crate::get_book_dir; use clap::builder::NonEmptyStringValueParser; -use clap::{Arg, ArgAction, ArgMatches, Command}; +use clap::ArgAction; use mdbook::errors::Result; use mdbook::MDBook; use std::path::PathBuf; diff --git a/src/config.rs b/src/config.rs index 7f56e797..67b1a700 100644 --- a/src/config.rs +++ b/src/config.rs @@ -58,7 +58,7 @@ use std::io::Read; use std::path::{Path, PathBuf}; use std::str::FromStr; use toml::value::Table; -use toml::{self, Value}; +use toml::Value; use crate::errors::*; use crate::utils::{self, toml_ext::TomlExt}; diff --git a/src/theme/mod.rs b/src/theme/mod.rs index 6e6b509d..1c108d62 100644 --- a/src/theme/mod.rs +++ b/src/theme/mod.rs @@ -212,7 +212,6 @@ fn load_file_contents>(filename: P, dest: &mut Vec) -> Result mod tests { use super::*; use std::fs; - use std::path::PathBuf; use tempfile::Builder as TempFileBuilder; #[test] diff --git a/src/utils/fs.rs b/src/utils/fs.rs index 1c313216..d0d56760 100644 --- a/src/utils/fs.rs +++ b/src/utils/fs.rs @@ -1,6 +1,5 @@ use crate::errors::*; use log::{debug, trace}; -use std::convert::Into; use std::fs::{self, File}; use std::io::Write; use std::path::{Component, Path, PathBuf};