Skip to content

Commit

Permalink
after cargo fix --edition
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Getreu committed Nov 8, 2018
1 parent d936f42 commit 19df4d8
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
22 changes: 11 additions & 11 deletions src/finding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ use std::fmt;
use std::cmp::{Ord,Eq};
use std::cmp;

use helper::IdentifyFirstLast;
use crate::helper::IdentifyFirstLast;

#[cfg(not(test))]
use options::ARGS;
use crate::options::ARGS;
#[cfg(test)]
use self::tests::ARGS;

use options::Radix;
use options::ControlChars;
use crate::options::Radix;
use crate::options::ControlChars;

#[cfg(not(test))]
use input::WIN_STEP;
use crate::input::WIN_STEP;
#[cfg(test)]
use self::tests::WIN_STEP;

Expand All @@ -35,7 +35,7 @@ lazy_static! {

pub const CUT_LABEL: char = '\u{2691}';

use mission::Mission;
use crate::mission::Mission;

/// Initial capacity of the findings vector is
/// set to WIN_STEP / 32.
Expand Down Expand Up @@ -431,10 +431,10 @@ impl StringWriter for FindingCollection {
#[cfg(test)]
mod tests {
use super::*;
use options::{Args, Radix, ControlChars};
use mission::UnicodeBlockFilter;
use mission::Mission;
use helper::IdentifyFirstLast;
use crate::options::{Args, Radix, ControlChars};
use crate::mission::UnicodeBlockFilter;
use crate::mission::Mission;
use crate::helper::IdentifyFirstLast;

extern crate encoding;
use std::str;
Expand Down Expand Up @@ -679,7 +679,7 @@ mod tests {
/// Test the Unicode filter in macro
#[test]
fn test_scan_unicode_filter(){
use mission::Mission;
use crate::mission::Mission;
// This filter is not restrictive, everything should pass
static M9:Mission = Mission {encoding: encoding::all::ASCII,
filter1: UnicodeBlockFilter { and_mask:0xffe00000, and_result: 0,
Expand Down
14 changes: 7 additions & 7 deletions src/input.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! This module abstracts the data-input channels i.e. file and stdin.
use scanner::ScannerPool;
use crate::scanner::ScannerPool;

use std;
use std::path::Path;
Expand Down Expand Up @@ -271,20 +271,20 @@ fn from_stdin(sc: &mut ScannerPool) -> Result<(), Box<std::io::Error>> {
#[cfg(test)]
mod tests {
use super::*;
use options::{Args, Radix, ControlChars};
use crate::options::{Args, Radix, ControlChars};
extern crate tempdir;

use std::fs::File;
use std::io::Write;
use self::tempdir::TempDir;
use std::path::PathBuf;
use std::sync::mpsc;
use mission::Missions;
use finding::FindingCollection;
use finding::Finding;
use scanner::ScannerPool;
use crate::mission::Missions;
use crate::finding::FindingCollection;
use crate::finding::Finding;
use crate::scanner::ScannerPool;
use std::thread;
use options::FLAG_BYTES_MAX;
use crate::options::FLAG_BYTES_MAX;


lazy_static! {
Expand Down
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ mod mission;

mod input;

use input::{process_input};
use crate::input::{process_input};

extern crate docopt;
#[macro_use]
extern crate lazy_static;

mod options;
use options::ARGS;
use crate::options::ARGS;

mod scanner;
use scanner::ScannerPool;
use crate::scanner::ScannerPool;

mod finding;

Expand All @@ -37,7 +37,7 @@ use std::str;
use std::process;
use std::thread::JoinHandle;
use std::io;
use mission::MISSIONS;
use crate::mission::MISSIONS;

extern crate itertools;
use std::sync::mpsc;
Expand Down
10 changes: 5 additions & 5 deletions src/mission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ use std::cmp;
use std::str::FromStr;
use std::num;
use std::error;
use options::ARGS;
use crate::options::ARGS;
extern crate encoding;
use encoding::EncodingRef;
use options::ControlChars;
use crate::options::ControlChars;
use encoding::label::encoding_from_whatwg_label;
use codec::ascii::ASCII_GRAPHIC;
use crate::codec::ascii::ASCII_GRAPHIC;

lazy_static! {
pub static ref MISSIONS: Missions = Missions::new(&ARGS.flag_encoding,
Expand Down Expand Up @@ -350,8 +350,8 @@ impl Missions {
#[cfg(test)]
mod tests {
use std::str::FromStr;
use mission::UnicodeBlockFilter;
use mission::CliError;
use crate::mission::UnicodeBlockFilter;
use crate::mission::CliError;

#[test]
fn test_enc_opt_parser () {
Expand Down
20 changes: 10 additions & 10 deletions src/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,26 @@ use scoped_threadpool::Pool;


#[cfg(not(test))]
use input::WIN_STEP;
use crate::input::WIN_STEP;
#[cfg(test)]
use self::tests::WIN_STEP;

#[cfg(not(test))]
use input::WIN_OVERLAP;
use crate::input::WIN_OVERLAP;
#[cfg(test)]
use self::tests::WIN_OVERLAP;


#[cfg(not(test))]
use input::UTF8_LEN_MAX;
use crate::input::UTF8_LEN_MAX;
#[cfg(test)]
use self::tests::UTF8_LEN_MAX;


use mission::Mission;
use mission::Missions;
use crate::mission::Mission;
use crate::mission::Missions;

use finding::FindingCollection;
use crate::finding::FindingCollection;

/// As the `ScannerPool.scan_window()` function itself is stateless, the following variables
/// store some data that will be transfered from iteration to iteration.
Expand Down Expand Up @@ -310,16 +310,16 @@ impl <'a> ScannerPool <'a> {
#[cfg(test)]
mod tests {
use super::*;
use options::{Args, Radix, ControlChars};
use crate::options::{Args, Radix, ControlChars};
extern crate rand;
use finding::Finding;
use finding::FindingCollection;
use crate::finding::Finding;
use crate::finding::FindingCollection;

pub const WIN_STEP: usize = 17;
pub const WIN_OVERLAP: usize = 5 + 3; // flag_bytes + UTF8_LEN_MAX
pub const WIN_LEN: usize = WIN_STEP + WIN_OVERLAP as usize; // =25
pub const UTF8_LEN_MAX: u8 = 3;
use mission::Missions;
use crate::mission::Missions;

lazy_static! {
pub static ref ARGS:Args = Args {
Expand Down

0 comments on commit 19df4d8

Please sign in to comment.