summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPierre-Henri Symoneaux <pierre.henri.symoneaux@gmail.com>2019-08-25 12:52:52 +0200
committerPierre-Henri Symoneaux <pierre.henri.symoneaux@gmail.com>2019-08-25 12:52:52 +0200
commitfb2f5853ad9823a6aa8018a2e5d5b96f9b34dbd5 (patch)
tree6ca242cd1e69284c06a3be21cbab4ddc2a3b204a /src
parentfadaa64ec513177feeb858b0977b4c18899b4961 (diff)
Updated to rust 2018
Diffstat (limited to 'src')
-rw-r--r--src/cell.rs6
-rw-r--r--src/csv.rs4
-rw-r--r--src/lib.rs13
-rw-r--r--src/main.rs4
-rw-r--r--src/utils.rs2
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() {
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]