Skip to content

Commit

Permalink
Update to Rust 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstaro committed Jan 6, 2019
1 parent 5fc7825 commit 8dd0716
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 108 deletions.
125 changes: 54 additions & 71 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Expand Up @@ -8,6 +8,7 @@ license = "MIT"
readme = "README.md"
keywords = ["fake", "nonsense", "useless"]
categories = ["command-line-utilities", "command-line-interface"]
edition = "2018"

[badges]
travis-ci = { repository = "svenstaro/genact", branch = "master" }
Expand All @@ -16,8 +17,7 @@ maintenance = { status = "actively-developed" }
[dependencies]
pbr = "1.0"
yansi = "0.5"
# Switch back to rand once this is merged: https://github.com/rust-random/rand/pull/671
rand = { git = "https://github.com/rust-random/rand.git" }
rand = "0.6.3"
chrono = "0.4"
url = "1.6"
lazy_static = "1.0"
Expand Down
6 changes: 3 additions & 3 deletions src/bootlog.rs
Expand Up @@ -2,9 +2,9 @@
use rand::prelude::*;
use yansi::Paint;

use parse_args::AppConfig;
use utils::{csleep, dprint};
use BOOTLOG_LIST;
use crate::parse_args::AppConfig;
use crate::utils::{csleep, dprint};
use crate::BOOTLOG_LIST;

pub fn run(appconfig: &AppConfig) {
let mut rng = thread_rng();
Expand Down
4 changes: 2 additions & 2 deletions src/botnet.rs
@@ -1,6 +1,6 @@
use parse_args::AppConfig;
use crate::parse_args::AppConfig;
use rand::prelude::*;
use utils::{csleep, cursor_up, dprint, erase_line};
use crate::utils::{csleep, cursor_up, dprint, erase_line};
use yansi::Paint;

pub fn run(appconfig: &AppConfig) {
Expand Down
6 changes: 3 additions & 3 deletions src/cargo.rs
Expand Up @@ -4,9 +4,9 @@ use rand::distributions::{ChiSquared, Distribution};
use std::time::Instant;
use yansi::Paint;

use utils::csleep;
use PACKAGES_LIST;
use parse_args::AppConfig;
use crate::utils::csleep;
use crate::PACKAGES_LIST;
use crate::parse_args::AppConfig;

fn gen_package_version(rng: &mut ThreadRng) -> String {
let chi = ChiSquared::new(1.0);
Expand Down
6 changes: 3 additions & 3 deletions src/cc.rs
Expand Up @@ -2,9 +2,9 @@
use rand::prelude::*;
use std::path::Path;

use parse_args::AppConfig;
use utils::{csleep, gen_random_n_from_list_into_string};
use {CFILES_LIST, PACKAGES_LIST};
use crate::parse_args::AppConfig;
use crate::utils::{csleep, gen_random_n_from_list_into_string};
use crate::{CFILES_LIST, PACKAGES_LIST};

/// Generate a `String` containing all of the `file_list`'s file's parents as -I flags
fn generate_includes(file_list: &[&str], max: u32, rng: &mut ThreadRng) -> String {
Expand Down
6 changes: 3 additions & 3 deletions src/composer.rs
Expand Up @@ -3,9 +3,9 @@ use rand::prelude::*;
use rand::distributions::{ChiSquared, Distribution};
use yansi::Paint;

use utils::csleep;
use COMPOSERS_LIST;
use parse_args::AppConfig;
use crate::utils::csleep;
use crate::COMPOSERS_LIST;
use crate::parse_args::AppConfig;

fn gen_package_version(rng: &mut ThreadRng) -> String {
let chi = ChiSquared::new(1.0);
Expand Down
4 changes: 2 additions & 2 deletions src/cryptomining.rs
Expand Up @@ -6,8 +6,8 @@ use yansi::Paint;
use chrono::prelude::*;
use chrono::Duration;

use utils::{gen_hex_string, csleep};
use parse_args::AppConfig;
use crate::utils::{gen_hex_string, csleep};
use crate::parse_args::AppConfig;

pub fn run(appconfig: &AppConfig) {
let mut rng = thread_rng();
Expand Down
10 changes: 5 additions & 5 deletions src/download.rs
Expand Up @@ -4,12 +4,12 @@ use std::cmp::max;
use pbr::{ProgressBar, Units};

#[cfg(target_os = "emscripten")]
use utils::TermWriter;
use crate::utils::TermWriter;

use utils::{csleep, gen_file_name_with_ext};
use CFILES_LIST;
use EXTENSIONS_LIST;
use parse_args::AppConfig;
use crate::utils::{csleep, gen_file_name_with_ext};
use crate::CFILES_LIST;
use crate::EXTENSIONS_LIST;
use crate::parse_args::AppConfig;

pub fn run(appconfig: &AppConfig) {
let mut rng = thread_rng();
Expand Down
6 changes: 3 additions & 3 deletions src/kernel_compile.rs
Expand Up @@ -2,9 +2,9 @@
use rand::prelude::*;
use regex::Regex;

use utils::csleep;
use CFILES_LIST;
use parse_args::AppConfig;
use crate::utils::csleep;
use crate::CFILES_LIST;
use crate::parse_args::AppConfig;

/// Generate a build step for a header file
fn gen_header(arch: &str, rng: &mut ThreadRng) -> String {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Expand Up @@ -43,7 +43,7 @@ mod parse_args;

use rand::prelude::*;
use yansi::Paint;
use parse_args::parse_args;
use crate::parse_args::parse_args;

static BOOTLOG: &str = include_str!("../data/bootlog.txt");
static CFILES: &str = include_str!("../data/cfiles.txt");
Expand Down
4 changes: 2 additions & 2 deletions src/memdump.rs
Expand Up @@ -3,8 +3,8 @@ use rand::prelude::*;
use std::io::Write;
use std::io::stdout;

use utils::{csleep, dprint, is_printable_ascii, gen_hex_string};
use parse_args::AppConfig;
use crate::utils::{csleep, dprint, is_printable_ascii, gen_hex_string};
use crate::parse_args::AppConfig;

pub fn run(appconfig: &AppConfig) {
let mut rng = thread_rng();
Expand Down
2 changes: 1 addition & 1 deletion src/parse_args.rs
Expand Up @@ -28,7 +28,7 @@ impl AppConfig {
#[cfg(not(target_os = "emscripten"))]
{
use std::sync::atomic::Ordering;
use CTRLC_PRESSED;
use crate::CTRLC_PRESSED;
if CTRLC_PRESSED.load(Ordering::SeqCst) {
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/simcity.rs
@@ -1,9 +1,9 @@
use rand::prelude::*;
use parse_args::AppConfig;
use utils::{dprint, csleep};
use crate::parse_args::AppConfig;
use crate::utils::{dprint, csleep};
use yansi::Paint;

use SIMCITY_LIST;
use crate::SIMCITY_LIST;

pub fn run(appconfig: &AppConfig) {
const SPINNERS: &[&str] = &["/", "-", "\\", "|"];
Expand Down
8 changes: 4 additions & 4 deletions src/weblog.rs
@@ -1,11 +1,11 @@
/// Module that pretends to tail a web server log.
use rand::prelude::*;

use parse_args::AppConfig;
use crate::parse_args::AppConfig;
use chrono::prelude::*;
use EXTENSIONS_LIST;
use PACKAGES_LIST;
use utils::{csleep, dprint, gen_file_path};
use crate::EXTENSIONS_LIST;
use crate::PACKAGES_LIST;
use crate::utils::{csleep, dprint, gen_file_path};
static HTTP_CODES: &'static [u16] = &[200, 201, 400, 401, 403, 404, 500, 502, 503];

pub fn run(appconfig: &AppConfig) {
Expand Down

0 comments on commit 8dd0716

Please sign in to comment.