diff options
author | Pierre-Henri Symoneaux <pierre.henri.symoneaux@gmail.com> | 2019-08-25 12:52:52 +0200 |
---|---|---|
committer | Pierre-Henri Symoneaux <pierre.henri.symoneaux@gmail.com> | 2019-08-25 12:52:52 +0200 |
commit | fb2f5853ad9823a6aa8018a2e5d5b96f9b34dbd5 (patch) | |
tree | 6ca242cd1e69284c06a3be21cbab4ddc2a3b204a /src | |
parent | fadaa64ec513177feeb858b0977b4c18899b4961 (diff) |
Updated to rust 2018
Diffstat (limited to 'src')
-rw-r--r-- | src/cell.rs | 6 | ||||
-rw-r--r-- | src/csv.rs | 4 | ||||
-rw-r--r-- | src/lib.rs | 13 | ||||
-rw-r--r-- | src/main.rs | 4 | ||||
-rw-r--r-- | src/utils.rs | 2 |
5 files changed, 10 insertions, 19 deletions
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() { @@ -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\ @@ -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] |