Permalink
Browse files

Move to 2018 edition

  • Loading branch information...
Aaronepower committed Jan 10, 2019
1 parent 755070e commit 6687d0772945d79d11a7277bb88febdf64d524a5
Showing with 22 additions and 34 deletions.
  1. +1 −0 Cargo.toml
  2. +2 −2 src/cli.rs
  3. +1 −1 src/cli_utils.rs
  4. +1 −1 src/config.rs
  5. +3 −3 src/language/language_type.rs
  6. +2 −4 src/language/languages.rs
  7. +2 −3 src/language/mod.rs
  8. +4 −10 src/lib.rs
  9. +3 −7 src/main.rs
  10. +3 −3 src/utils/fs.rs
@@ -11,6 +11,7 @@ name = "tokei"
readme = "README.md"
repository = "https://github.com/Aaronepower/tokei.git"
version = "8.0.1"
edition = "2018"

[badges]
[badges.appveyor]
@@ -1,8 +1,8 @@
use clap::ArgMatches;
use tokei::{LanguageType, Sort};

use input::Format;
use cli_utils::*;
use crate::input::Format;
use crate::cli_utils::*;

pub struct Cli<'a> {
matches: ArgMatches<'a>,
@@ -2,7 +2,7 @@ use std::str::FromStr;
use std::{fmt, process, io::{self, Write}};

use tokei::{Language, LanguageType};
use input::Format;
use crate::input::Format;

pub const FALLBACK_ROW_LEN: usize = 79;
const NO_LANG_HEADER_ROW_LEN: usize = 67;
@@ -2,7 +2,7 @@
use std::{env, fs};
use std::path::PathBuf;

use language::LanguageType;
use crate::language::LanguageType;

/// A configuration struct for how [`Languages::get_statistics`] searches and
/// counts languages.
@@ -7,12 +7,12 @@ use std::str::FromStr;

use encoding_rs_io::DecodeReaderBytes;

use utils::fs as fsutils;
use crate::utils::fs as fsutils;
use self::LanguageType::*;
use stats::Stats;
use crate::stats::Stats;

use super::syntax::SyntaxCounter;
use config::Config;
use crate::config::Config;

include!(concat!(env!("OUT_DIR"), "/language_type.rs"));

@@ -8,11 +8,9 @@ use std::ops::{AddAssign, Deref, DerefMut};

use rayon::prelude::*;

use serde;

use config::Config;
use crate::config::Config;
use super::{Language, LanguageType};
use utils;
use crate::utils;

/// A newtype representing a list of languages counted in the provided
/// directory.
@@ -12,9 +12,8 @@ use std::ops::AddAssign;
pub use self::languages::Languages;
pub use self::language_type::*;

use sort::Sort::*;
use sort::Sort;
use stats::Stats;
use crate::sort::Sort::{self, *};
use crate::stats::Stats;

/// A struct representing statistics about a single Language.
#[derive(Clone, Debug, Deserialize, Default, Serialize)]
@@ -46,20 +46,14 @@

#[macro_use] extern crate log;
#[macro_use] extern crate serde_derive;
extern crate dirs;
extern crate encoding_rs_io;
extern crate ignore;
extern crate rayon;
extern crate serde;
extern crate toml;

#[macro_use] mod utils;
mod config;
mod language;
mod sort;
mod stats;

pub use language::{LanguageType, Languages, Language};
pub use stats::Stats;
pub use sort::Sort;
pub use config::Config;
pub use self::language::{LanguageType, Languages, Language};
pub use self::stats::Stats;
pub use self::sort::Sort;
pub use self::config::Config;
@@ -3,10 +3,6 @@
// found in the LICENCE-{APACHE, MIT} file.

#[macro_use] extern crate clap;
extern crate env_logger;
extern crate log;
extern crate term_size;
extern crate tokei;

mod cli;
mod cli_utils;
@@ -16,9 +12,9 @@ use std::{error::Error, process, io::{self, Write}};

use tokei::{Language, Languages, Sort, Config};

use cli::Cli;
use cli_utils::*;
use input::*;
use crate::cli::Cli;
use crate::cli_utils::*;
use crate::input::*;

fn main() -> Result<(), Box<Error>> {
let mut cli = Cli::from_args();
@@ -14,9 +14,9 @@ use ignore::WalkState::*;
use rayon::prelude::*;

// This is just a re-export from the auto generated file.
pub use language::get_filetype_from_shebang;
use language::{Language, LanguageType};
use config::Config;
pub use crate::language::get_filetype_from_shebang;
use crate::language::{Language, LanguageType};
use crate::config::Config;

pub fn get_all_files(paths: &[&str],
ignored_directories: &[&str],

0 comments on commit 6687d07

Please sign in to comment.