From 3e24f64d9652bebe49838f244f1e1bfa2cc45f17 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sat, 4 Sep 2021 16:07:30 +0200 Subject: crate name: util → isabelle2unicode --- Cargo.toml | 2 +- isabelle2unicode/Cargo.toml | 10 ++++++++++ isabelle2unicode/src/main.rs | 23 +++++++++++++++++++++++ util/Cargo.toml | 10 ---------- util/src/main.rs | 23 ----------------------- 5 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 isabelle2unicode/Cargo.toml create mode 100644 isabelle2unicode/src/main.rs delete mode 100644 util/Cargo.toml delete mode 100644 util/src/main.rs diff --git a/Cargo.toml b/Cargo.toml index 26188a3..fbb6fcd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,5 +2,5 @@ members = [ "symbolmacro", "isabelle-unicode", - "util" + "isabelle2unicode" ] diff --git a/isabelle2unicode/Cargo.toml b/isabelle2unicode/Cargo.toml new file mode 100644 index 0000000..53a5aa4 --- /dev/null +++ b/isabelle2unicode/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "isabelle2unicode" +version = "0.1.0" +authors = ["stuebinm "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +isabelle-unicode = { path = "../isabelle-unicode" } diff --git a/isabelle2unicode/src/main.rs b/isabelle2unicode/src/main.rs new file mode 100644 index 0000000..4670b38 --- /dev/null +++ b/isabelle2unicode/src/main.rs @@ -0,0 +1,23 @@ +use std::io; +use std::io::BufRead; + +use isabelle_unicode::PrettyUnicode; + + +fn main() { + + let stdin = io::stdin(); + + stdin.lock() + .lines() + .filter_map(|line| match line { + Ok(line) if line.trim().is_empty() + => Some("\n".to_string()), + Ok(line) + => line.to_pretty_unicode(), + Err(_) + => None + }) + .for_each(|line| print!("{}", line)); + +} diff --git a/util/Cargo.toml b/util/Cargo.toml deleted file mode 100644 index 70d66bf..0000000 --- a/util/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "util" -version = "0.1.0" -authors = ["stuebinm "] -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -isabelle-unicode = { path = "../isabelle-unicode" } diff --git a/util/src/main.rs b/util/src/main.rs deleted file mode 100644 index 4670b38..0000000 --- a/util/src/main.rs +++ /dev/null @@ -1,23 +0,0 @@ -use std::io; -use std::io::BufRead; - -use isabelle_unicode::PrettyUnicode; - - -fn main() { - - let stdin = io::stdin(); - - stdin.lock() - .lines() - .filter_map(|line| match line { - Ok(line) if line.trim().is_empty() - => Some("\n".to_string()), - Ok(line) - => line.to_pretty_unicode(), - Err(_) - => None - }) - .for_each(|line| print!("{}", line)); - -} -- cgit v1.2.3