Merge imports (#1462)

This commit is contained in:
Casey Rodarmor 2022-12-27 20:16:18 -08:00 committed by GitHub
parent e7721d0a84
commit 157862d398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 47 additions and 62 deletions

View File

@ -1,5 +1,4 @@
use regex::Regex; use {regex::Regex, structopt::StructOpt};
use structopt::StructOpt;
#[derive(StructOpt)] #[derive(StructOpt)]
struct Arguments { struct Arguments {

View File

@ -1,5 +1,7 @@
use executable_path::executable_path; use {
use std::{process::Command, str}; executable_path::executable_path,
std::{process::Command, str},
};
fn stdout(reference: &str) -> String { fn stdout(reference: &str) -> String {
let output = Command::new(executable_path("ref-type")) let output = Command::new(executable_path("ref-type"))

View File

@ -1,6 +1,4 @@
use super::*; use {super::*, CompileErrorKind::*};
use CompileErrorKind::*;
const VALID_ALIAS_ATTRIBUTES: [Attribute; 1] = [Attribute::Private]; const VALID_ALIAS_ATTRIBUTES: [Attribute; 1] = [Attribute::Private];

View File

@ -1,6 +1,4 @@
use super::*; use {super::*, CompileErrorKind::*};
use CompileErrorKind::*;
pub(crate) struct AssignmentResolver<'src: 'run, 'run> { pub(crate) struct AssignmentResolver<'src: 'run, 'run> {
assignments: &'run Table<'src, Assignment<'src>>, assignments: &'run Table<'src, Assignment<'src>>,

View File

@ -1,7 +1,8 @@
use super::*; use {
super::*,
use ansi_term::{ANSIGenericString, Color::*, Prefix, Style, Suffix}; ansi_term::{ANSIGenericString, Color::*, Prefix, Style, Suffix},
use atty::Stream; atty::Stream,
};
#[derive(Copy, Clone, Debug, PartialEq)] #[derive(Copy, Clone, Debug, PartialEq)]
pub(crate) struct Color { pub(crate) struct Color {

View File

@ -1,6 +1,7 @@
use super::*; use {
super::*,
use clap::{App, AppSettings, Arg, ArgGroup, ArgMatches, ArgSettings}; clap::{App, AppSettings, Arg, ArgGroup, ArgMatches, ArgSettings},
};
// These three strings should be kept in sync: // These three strings should be kept in sync:
pub(crate) const CHOOSER_DEFAULT: &str = "fzf"; pub(crate) const CHOOSER_DEFAULT: &str = "fzf";

View File

@ -1,15 +1,15 @@
#![allow(unknown_lints)] #![allow(unknown_lints)]
#![allow(clippy::unnecessary_wraps)] #![allow(clippy::unnecessary_wraps)]
use super::*; use {
super::*,
use heck::{ heck::{
ToKebabCase, ToLowerCamelCase, ToShoutyKebabCase, ToShoutySnakeCase, ToSnakeCase, ToTitleCase, ToKebabCase, ToLowerCamelCase, ToShoutyKebabCase, ToShoutySnakeCase, ToSnakeCase, ToTitleCase,
ToUpperCamelCase, ToUpperCamelCase,
},
Function::*,
}; };
use Function::*;
pub(crate) enum Function { pub(crate) enum Function {
Nullary(fn(&FunctionContext) -> Result<String, String>), Nullary(fn(&FunctionContext) -> Result<String, String>),
Unary(fn(&FunctionContext, &str) -> Result<String, String>), Unary(fn(&FunctionContext, &str) -> Result<String, String>),

View File

@ -1,6 +1,4 @@
use super::*; use {super::*, serde::Serialize};
use serde::Serialize;
#[derive(Debug, PartialEq, Serialize)] #[derive(Debug, PartialEq, Serialize)]
pub(crate) struct Justfile<'src> { pub(crate) struct Justfile<'src> {

View File

@ -1,7 +1,4 @@
use super::*; use {super::*, CompileErrorKind::*, TokenKind::*};
use CompileErrorKind::*;
use TokenKind::*;
/// Just language lexer /// Just language lexer
/// ///

View File

@ -1,6 +1,4 @@
use super::*; use {super::*, TokenKind::*};
use TokenKind::*;
/// Just language parser /// Just language parser
/// ///

View File

@ -1,6 +1,7 @@
use super::*; use {
super::*,
use std::process::{ExitStatus, Stdio}; std::process::{ExitStatus, Stdio},
};
/// Return a `Error::Signal` if the process was terminated by a signal, /// Return a `Error::Signal` if the process was terminated by a signal,
/// otherwise return an `Error::UnknownFailure` /// otherwise return an `Error::UnknownFailure`

View File

@ -1,6 +1,4 @@
use super::*; use {super::*, CompileErrorKind::*};
use CompileErrorKind::*;
pub(crate) struct RecipeResolver<'src: 'run, 'run> { pub(crate) struct RecipeResolver<'src: 'run, 'run> {
unresolved_recipes: Table<'src, UnresolvedRecipe<'src>>, unresolved_recipes: Table<'src, UnresolvedRecipe<'src>>,

View File

@ -1,6 +1,4 @@
use super::*; use {super::*, std::path::Component};
use std::path::Component;
const DEFAULT_JUSTFILE_NAME: &str = JUSTFILE_NAMES[0]; const DEFAULT_JUSTFILE_NAME: &str = JUSTFILE_NAMES[0];
const JUSTFILE_NAMES: &[&str] = &["justfile", ".justfile"]; const JUSTFILE_NAMES: &[&str] = &["justfile", ".justfile"];

View File

@ -12,9 +12,10 @@
//! that changes to just do not inadvertently break or change the interpretation //! that changes to just do not inadvertently break or change the interpretation
//! of existing justfiles. //! of existing justfiles.
use std::{collections::BTreeMap, fs, io, path::Path}; use {
crate::compiler::Compiler,
use crate::compiler::Compiler; std::{collections::BTreeMap, fs, io, path::Path},
};
mod full { mod full {
pub(crate) use crate::{ pub(crate) use crate::{

View File

@ -1,6 +1,4 @@
use super::*; use {super::*, std::collections::btree_map};
use std::collections::btree_map;
#[derive(Debug, PartialEq, Serialize)] #[derive(Debug, PartialEq, Serialize)]
#[serde(transparent)] #[serde(transparent)]

View File

@ -1,7 +1,4 @@
use super::*; use {super::*, crate::compiler::Compiler, pretty_assertions::assert_eq};
use crate::compiler::Compiler;
use pretty_assertions::assert_eq;
pub(crate) fn compile(text: &str) -> Justfile { pub(crate) fn compile(text: &str) -> Justfile {
match Compiler::compile(text) { match Compiler::compile(text) {

View File

@ -1,6 +1,7 @@
use super::*; use {
super::*,
use std::{borrow::Cow, mem}; std::{borrow::Cow, mem},
};
/// Construct a `Tree` from a symbolic expression literal. This macro, and the /// Construct a `Tree` from a symbolic expression literal. This macro, and the
/// Tree type, are only used in the Parser unit tests, providing a concise /// Tree type, are only used in the Parser unit tests, providing a concise

View File

@ -1,6 +1,7 @@
use super::*; use {
super::*,
use std::time::{Duration, Instant}; std::time::{Duration, Instant},
};
fn kill(process_id: u32) { fn kill(process_id: u32) {
unsafe { unsafe {

View File

@ -1,6 +1,4 @@
use super::*; use {super::*, pretty_assertions::assert_eq};
use pretty_assertions::assert_eq;
macro_rules! test { macro_rules! test {
{ {