mirror of
https://github.com/facebook/sapling.git
synced 2024-12-29 08:02:24 +03:00
Delete lines of the form "use [a-z_]+;"
Summary: I think these are left over from pre-2018 code where they may have been necessary. In 2018 edition, import paths in `use` always begin with a crate name or `crate`/`super`/`self`, so `use $ident;` always refers to a crate. Since extern crates are always in scope in every module, `use $ident` does nothing. Reviewed By: Imxset21 Differential Revision: D17290473 fbshipit-source-id: 23d86e5d0dcd5c2d4e53c7a36b4267101dd4b45c
This commit is contained in:
parent
5ca548a963
commit
97c13edcc7
@ -3,8 +3,6 @@
|
||||
// This software may be used and distributed according to the terms of the
|
||||
// GNU General Public License version 2 or any later version.
|
||||
|
||||
use env_logger;
|
||||
|
||||
/// Perform any initialization necessesary for Mercurial's Rust extensions.
|
||||
pub(crate) fn init_rust() {
|
||||
env_logger::init();
|
||||
|
@ -11,7 +11,6 @@ use std::{
|
||||
use cpython::*;
|
||||
use failure::{format_err, Error, Fallible};
|
||||
|
||||
use encoding;
|
||||
use revisionstore::{
|
||||
repack::{filter_incrementalpacks, list_packs, repack_datapacks, repack_historypacks},
|
||||
Ancestors, CorruptionPolicy, DataPack, DataPackStore, DataPackVersion, DataStore, Delta,
|
||||
|
@ -1,8 +1,6 @@
|
||||
// Copyright Facebook, Inc. 2018
|
||||
use dirs;
|
||||
use encoding::osstring_to_local_cstring;
|
||||
use libc::{c_char, c_int};
|
||||
use std;
|
||||
use std::ffi::{CString, OsString};
|
||||
use std::path::Path;
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
// GNU General Public License version 2 or any later version.
|
||||
|
||||
use failure::Fallible;
|
||||
use serde_json;
|
||||
use std::collections::HashMap;
|
||||
use std::net::{SocketAddr, TcpListener};
|
||||
use std::thread;
|
||||
|
@ -14,7 +14,6 @@ use crate::util;
|
||||
use eventsource::reqwest::Client;
|
||||
use failure::Fallible;
|
||||
use reqwest::Url;
|
||||
use serde_json;
|
||||
use std::collections::HashMap;
|
||||
use std::net::ToSocketAddrs;
|
||||
use std::path::PathBuf;
|
||||
|
@ -16,7 +16,6 @@ use std::sync::Arc;
|
||||
use bytes::Bytes;
|
||||
use indexmap::IndexMap;
|
||||
use pest::{self, Parser, Span};
|
||||
use shellexpand;
|
||||
|
||||
use crate::error::Error;
|
||||
use crate::parser::{ConfigParser, Rule};
|
||||
|
@ -12,7 +12,6 @@ use std::hash::Hash;
|
||||
use std::path::Path;
|
||||
|
||||
use bytes::Bytes;
|
||||
use dirs;
|
||||
use failure::Fallible;
|
||||
|
||||
use crate::config::{expand_path, ConfigSet, Options};
|
||||
|
@ -6,7 +6,6 @@
|
||||
use crate::idmap::IdMap;
|
||||
use crate::segment::{Dag, Level};
|
||||
use crate::spanset::SpanSet;
|
||||
use drawdag;
|
||||
use failure::Fallible;
|
||||
use tempfile::tempdir;
|
||||
|
||||
|
@ -16,7 +16,6 @@ use curl::{
|
||||
};
|
||||
use failure::{format_err, ResultExt};
|
||||
use itertools::Itertools;
|
||||
use log;
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use serde_cbor::Deserializer;
|
||||
use url::Url;
|
||||
|
@ -118,7 +118,6 @@ mod tests {
|
||||
|
||||
#[cfg(windows)]
|
||||
fn get_encoded_sample() -> (String, Vec<u8>) {
|
||||
use kernel32;
|
||||
match unsafe { kernel32::GetACP() } {
|
||||
1250 => ("Ł".into(), vec![163]),
|
||||
1251 => ("Ї".into(), vec![175]),
|
||||
|
@ -3,14 +3,11 @@
|
||||
// This software may be used and distributed according to the terms of the
|
||||
// GNU General Public License version 2 or any later version.
|
||||
|
||||
use kernel32;
|
||||
use std;
|
||||
use std::borrow::Cow;
|
||||
use std::ffi::{OsStr, OsString};
|
||||
use std::io;
|
||||
use std::os::windows::ffi::{OsStrExt, OsStringExt};
|
||||
use std::path::{Path, PathBuf};
|
||||
use winapi;
|
||||
|
||||
const MB_ERR_INVALID_CHARS: winapi::DWORD = 0x00000008;
|
||||
const WC_COMPOSITECHECK: winapi::DWORD = 0x00000200;
|
||||
|
@ -4,8 +4,6 @@
|
||||
// GNU General Public License version 2 or any later version.
|
||||
|
||||
use failure::Fallible;
|
||||
use serde;
|
||||
use serde_json;
|
||||
use std::path::{Path, PathBuf};
|
||||
use watchman_client::queries::*;
|
||||
use watchman_client::transport::Transport;
|
||||
|
@ -5,7 +5,6 @@ use python27_sys::{
|
||||
PyEval_InitThreads, PySys_SetArgv, Py_Finalize, Py_Initialize, Py_IsInitialized,
|
||||
Py_SetProgramName,
|
||||
};
|
||||
use std;
|
||||
use std::ffi::CString;
|
||||
|
||||
pub fn py_set_argv(args: Vec<CString>) {
|
||||
|
@ -11,7 +11,6 @@ use std::{
|
||||
};
|
||||
|
||||
use memmap::{Mmap, MmapOptions};
|
||||
use tempfile;
|
||||
use twox_hash::{XxHash, XxHash32};
|
||||
|
||||
/// Return a read-only mmap view of the entire file, and its length.
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
use crate::{Error, Result};
|
||||
use byteorder::{NetworkEndian, ReadBytesExt};
|
||||
use serde;
|
||||
use serde::de::{
|
||||
self, Deserialize, DeserializeSeed, EnumAccess, IntoDeserializer, SeqAccess, VariantAccess,
|
||||
Visitor,
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
use crate::{Error, Result};
|
||||
use byteorder::{NetworkEndian, WriteBytesExt};
|
||||
use serde;
|
||||
use serde::ser::{
|
||||
SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant, SerializeTuple,
|
||||
SerializeTupleStruct, SerializeTupleVariant,
|
||||
|
@ -402,9 +402,6 @@ fn sha1(value: &[u8]) -> Node {
|
||||
(&buf).into()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
use quickcheck;
|
||||
|
||||
#[cfg(test)]
|
||||
impl quickcheck::Arbitrary for FileSectionLocation {
|
||||
fn arbitrary<G: quickcheck::Gen>(g: &mut G) -> Self {
|
||||
|
@ -103,9 +103,6 @@ pub struct FileStateV2 {
|
||||
pub copied: Option<Box<[u8]>>,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
use rand;
|
||||
|
||||
#[cfg(test)]
|
||||
impl rand::distributions::Distribution<FileStateV2> for rand::distributions::Standard {
|
||||
fn sample<R: rand::Rng + ?Sized>(&self, rng: &mut R) -> FileStateV2 {
|
||||
|
@ -5,7 +5,6 @@ use crate::errors::ErrorKind;
|
||||
use crate::store::{BlockId, Store, StoreView};
|
||||
use byteorder::{BigEndian, ByteOrder, ReadBytesExt, WriteBytesExt};
|
||||
use failure::{bail, Fallible};
|
||||
use std;
|
||||
use std::borrow::Cow;
|
||||
use std::cell::RefCell;
|
||||
use std::fs::File;
|
||||
|
@ -218,7 +218,6 @@ impl<'a, K: 'a, V: 'a> Iterator for IterMut<'a, K, V> {
|
||||
mod tests {
|
||||
|
||||
use crate::vecmap::{Iter, VecMap};
|
||||
use itertools;
|
||||
use quickcheck::quickcheck;
|
||||
use std::collections::BTreeMap;
|
||||
use std::collections::Bound::*;
|
||||
|
@ -3,7 +3,6 @@
|
||||
use bytes::Bytes;
|
||||
use crypto::{digest::Digest, sha1::Sha1};
|
||||
use failure::{ensure, Fallible};
|
||||
use log;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
use crate::{key::Key, node::Node, parents::Parents};
|
||||
|
@ -144,7 +144,6 @@ impl Arbitrary for Parents {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
use serde_cbor;
|
||||
use serde_json::{self, json};
|
||||
|
||||
#[test]
|
||||
|
@ -5,9 +5,6 @@
|
||||
|
||||
use crate::error::*;
|
||||
use failure::Fallible;
|
||||
use serde;
|
||||
use serde_bser;
|
||||
use serde_json;
|
||||
use std::io::{BufRead, Read, Write};
|
||||
|
||||
pub trait Protocol {
|
||||
|
@ -4,7 +4,6 @@
|
||||
// GNU General Public License version 2 or any later version.
|
||||
|
||||
use crate::path::decode_path_fallible;
|
||||
use serde_json;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[derive(Clone, Default, Debug, Serialize, Deserialize, PartialEq)]
|
||||
|
@ -7,8 +7,6 @@ extern crate bytes;
|
||||
|
||||
use self::bytes::Buf;
|
||||
use crate::queries::*;
|
||||
use serde_bser;
|
||||
use serde_json;
|
||||
use std::io::Cursor;
|
||||
|
||||
/// Parsing tests
|
||||
|
@ -7,7 +7,6 @@ use crate::error::*;
|
||||
use crate::protocol::{JsonProtocol, Protocol};
|
||||
use crate::queries::*;
|
||||
use failure::Fallible;
|
||||
use serde;
|
||||
use std::io::BufReader;
|
||||
use std::marker::PhantomData;
|
||||
use std::path::Path;
|
||||
|
Loading…
Reference in New Issue
Block a user