diff --git a/.gitignore b/.gitignore index daaca46..a3701a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /target +/tests **/*.rs.bk Cargo.lock -/tests diff --git a/README.md b/README.md index e69de29..25fa1e5 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,28 @@ +# owoify +A simple rust library for string owoification. +Inspired by: +* [owo text generator](https://honk.moe/tools/owo.html) +* [OWO Chrome extension](https://chrome.google.com/webstore/detail/owo/jolaggjkdhhgcdhcjjhfkkbllefoggob?hl=en) + +# Credits +* [MashAllPotatoes](https://twitter.com/MashNewGamePlus) - Regular expressions and some of the owo faces + +# Usage +Add this to ``Cargo.toml``: + +``` +[dependencies] +owoify = "0.1.0" +``` +``example.rs``: +``` +use owoify::OwOifiable; + +fn main() { + let text = String::from("euthanize me senpai!!"); + println!("{}", text.owoify()); +} +``` + +# Documentation +* [Docs.rs](https://docs.rs/owoify) diff --git a/src/lib.rs b/src/lib.rs index f87b48a..21e5a3b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,9 +24,17 @@ pub trait OwOifiable { } impl OwOifiable for String { + /// Owoifies a String + /// + /// # Examples + /// + /// ``` + /// use use owoify::OwOifiable; + /// let owoified = String::from("Example text").owoify(); + /// ``` fn owoify(&self) -> Self { let mut rng = rand::thread_rng(); - let faces = ["(・`ω´・)", ";;w;;", "owo", "UwU", ">w<", "^w^"]; + let faces = ["(・`ω´・)", "OwO", "owo", "oωo", "òωó", "°ω°", "UwU", ">w<", "^w^"]; let face = &format!(" {} ", faces[rng.gen_range(0, faces.len())]).to_owned(); let pats: Vec<(&str, &str)> = vec![ ("(?:r|l)", "w"),