From fb2f5853ad9823a6aa8018a2e5d5b96f9b34dbd5 Mon Sep 17 00:00:00 2001 From: Pierre-Henri Symoneaux Date: Sun, 25 Aug 2019 12:52:52 +0200 Subject: Updated to rust 2018 --- src/cell.rs | 6 +++--- src/csv.rs | 4 ++-- src/lib.rs | 13 +++---------- src/main.rs | 4 +--- src/utils.rs | 2 +- 5 files changed, 10 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/cell.rs b/src/cell.rs index 61e71ca..795c4c7 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -320,10 +320,10 @@ macro_rules! cell { #[cfg(test)] mod tests { - use Cell; - use format::Alignment; + use super::Cell; + use crate::format::Alignment; use term::{color, Attr}; - use utils::StringWriter; + use crate::utils::StringWriter; #[test] fn get_content() { diff --git a/src/csv.rs b/src/csv.rs index 55f10e2..417e8e6 100644 --- a/src/csv.rs +++ b/src/csv.rs @@ -1,6 +1,6 @@ //! CSV impl and reexported types -extern crate csv; +use csv; pub use self::csv::{Reader, Writer, Result, ReaderBuilder}; use std::path::Path; @@ -81,7 +81,7 @@ impl super::Table { #[cfg(test)] mod tests { - use {Table, Row, Cell}; + use crate::{Table, Row, Cell}; static CSV_S: &'static str = "ABC,DEFG,HIJKLMN\n\ foobar,bar,foo\n\ diff --git a/src/lib.rs b/src/lib.rs index cc9dd0b..66daaf9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,12 +3,9 @@ unused_import_braces, unused_qualifications)] //! A formatted and aligned table printer written in rust -extern crate unicode_width; -extern crate term; -extern crate atty; +//! #[macro_use] extern crate lazy_static; -extern crate encode_unicode; use std::io::{self, Write, Error}; use std::fmt; @@ -587,13 +584,9 @@ macro_rules! ptable { #[cfg(test)] mod tests { - use Table; - use Slice; - use Row; - use Cell; - use format; + use crate::{Table, Slice, Row, Cell, format}; use format::consts::{FORMAT_DEFAULT, FORMAT_NO_LINESEP, FORMAT_NO_COLSEP, FORMAT_CLEAN, FORMAT_BOX_CHARS}; - use utils::StringWriter; + use crate::utils::StringWriter; #[test] fn table() { diff --git a/src/main.rs b/src/main.rs index 3cf20c5..28d7b78 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,9 @@ -// #![feature(trace_macros)] -#[macro_use] -extern crate prettytable; use prettytable::Table; use prettytable::Row; use prettytable::Cell; use prettytable::format::*; use prettytable::{Attr, color}; +use prettytable::{table, row, ptable}; // Import macros // trace_macros!(true); diff --git a/src/utils.rs b/src/utils.rs index 79e3be8..f2d89ae 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -108,7 +108,7 @@ pub fn display_width(text: &str) -> usize { #[cfg(test)] mod tests { use super::*; - use format::Alignment; + use crate::format::Alignment; use std::io::Write; #[test] -- cgit v1.2.3