diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-07-22 15:14:39 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-07-27 01:41:04 +0300 |
commit | d84ceca88e1882a8db3c7630633a3f840f4593d6 (patch) | |
tree | e6a70be2491dd69ae6e6ff1c1c9496c4c2d5e61b | |
parent | ff37e97cbad1d95235ded0631973cc83cb2515fc (diff) |
create text_processing crate
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | melib/Cargo.toml | 2 | ||||
-rw-r--r-- | melib/src/email/compose/mime.rs | 2 | ||||
-rw-r--r-- | melib/src/lib.rs | 6 | ||||
-rw-r--r-- | melib/src/thread.rs | 2 | ||||
-rw-r--r-- | text_processing/Cargo.toml | 9 | ||||
-rw-r--r-- | text_processing/src/grapheme_clusters.rs (renamed from melib/src/grapheme_clusters.rs) | 2 | ||||
-rw-r--r-- | text_processing/src/lib.rs | 4 | ||||
-rw-r--r-- | text_processing/src/wcwidth.rs (renamed from melib/src/wcwidth.rs) | 0 | ||||
-rw-r--r-- | ui/Cargo.toml | 1 | ||||
-rw-r--r-- | ui/src/lib.rs | 2 | ||||
-rw-r--r-- | ui/src/terminal/text_editing.rs | 2 |
12 files changed, 24 insertions, 10 deletions
@@ -20,4 +20,4 @@ lto = true debug = false [workspace] -members = ["melib", "ui", "debug_printer", "testing"] +members = ["melib", "ui", "debug_printer", "testing", "text_processing"] diff --git a/melib/Cargo.toml b/melib/Cargo.toml index 9f4f38d7..a5497248 100644 --- a/melib/Cargo.toml +++ b/melib/Cargo.toml @@ -23,4 +23,4 @@ serde = "1.0.71" serde_derive = "1.0.71" bincode = "1.0.1" uuid = { version = "0.6", features = ["serde", "v4"] } -unicode-segmentation = "1.2.1" # >:c +text_processing = { path = "../text_processing", version = "*" } diff --git a/melib/src/email/compose/mime.rs b/melib/src/email/compose/mime.rs index ebcb6658..081e11d1 100644 --- a/melib/src/email/compose/mime.rs +++ b/melib/src/email/compose/mime.rs @@ -1,5 +1,5 @@ use super::*; -use crate::grapheme_clusters::Graphemes; +use text_processing::grapheme_clusters::Graphemes; pub fn encode_header(value: &str) -> String { let mut ret = String::with_capacity(value.len()); diff --git a/melib/src/lib.rs b/melib/src/lib.rs index ce5424b1..5e9c6f7d 100644 --- a/melib/src/lib.rs +++ b/melib/src/lib.rs @@ -84,6 +84,8 @@ pub mod dbg { } } +extern crate text_processing; + pub mod addressbook; pub mod async_workers; pub mod backends; @@ -91,14 +93,10 @@ mod collection; pub mod conf; pub mod email; pub mod error; -pub mod grapheme_clusters; pub mod mailbox; pub mod thread; pub use crate::email::*; pub use crate::thread::*; -mod wcwidth; -pub use self::grapheme_clusters::*; -pub use self::wcwidth::*; mod structs; pub use self::structs::*; diff --git a/melib/src/thread.rs b/melib/src/thread.rs index 9a97150e..9b034e6c 100644 --- a/melib/src/thread.rs +++ b/melib/src/thread.rs @@ -34,8 +34,8 @@ use crate::email::parser::BytesExt; use crate::email::*; -use crate::grapheme_clusters::*; use crate::structs::StackVec; +use text_processing::grapheme_clusters::*; use uuid::Uuid; use fnv::{FnvHashMap, FnvHashSet}; diff --git a/text_processing/Cargo.toml b/text_processing/Cargo.toml new file mode 100644 index 00000000..4b6b1c02 --- /dev/null +++ b/text_processing/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "text_processing" +version = "0.0.1" #:version +authors = ["Manos Pitsidianakis <el13635@mail.ntua.gr>"] +workspace = ".." +edition = "2018" + +[dependencies] +unicode-segmentation = "1.2.1" diff --git a/melib/src/grapheme_clusters.rs b/text_processing/src/grapheme_clusters.rs index db6b5427..b1f825bf 100644 --- a/melib/src/grapheme_clusters.rs +++ b/text_processing/src/grapheme_clusters.rs @@ -8,7 +8,7 @@ */ -use super::*; +use crate::wcwidth::{wcwidth, CodePointsIter}; extern crate unicode_segmentation; use self::unicode_segmentation::UnicodeSegmentation; diff --git a/text_processing/src/lib.rs b/text_processing/src/lib.rs new file mode 100644 index 00000000..3b7b33ae --- /dev/null +++ b/text_processing/src/lib.rs @@ -0,0 +1,4 @@ +pub mod grapheme_clusters; +pub mod wcwidth; +pub use grapheme_clusters::*; +pub use wcwidth::*; diff --git a/melib/src/wcwidth.rs b/text_processing/src/wcwidth.rs index 0a16cae6..0a16cae6 100644 --- a/melib/src/wcwidth.rs +++ b/text_processing/src/wcwidth.rs diff --git a/ui/Cargo.toml b/ui/Cargo.toml index 920589e5..fdc30a88 100644 --- a/ui/Cargo.toml +++ b/ui/Cargo.toml @@ -24,3 +24,4 @@ termion = "1.5.1" bincode = "1.0.1" uuid = { version = "0.6", features = ["serde", "v4"] } unicode-segmentation = "1.2.1" # >:c +text_processing = { path = "../text_processing", version = "*" } diff --git a/ui/src/lib.rs b/ui/src/lib.rs index 5eac5a99..fed7fc92 100644 --- a/ui/src/lib.rs +++ b/ui/src/lib.rs @@ -27,6 +27,7 @@ extern crate melib; extern crate mime_apps; extern crate notify_rust; +extern crate text_processing; #[macro_use] extern crate serde_derive; #[macro_use] @@ -45,6 +46,7 @@ extern crate serde_json; use melib::*; use std::collections::VecDeque; +use text_processing::*; #[macro_use] mod types; diff --git a/ui/src/terminal/text_editing.rs b/ui/src/terminal/text_editing.rs index e19588dc..01173c1e 100644 --- a/ui/src/terminal/text_editing.rs +++ b/ui/src/terminal/text_editing.rs @@ -1,4 +1,4 @@ -use melib::Graphemes; +use text_processing::Graphemes; #[derive(Debug, Clone, Default, PartialEq)] pub struct UText { |