Add credit for owo faces in README.md
This commit is contained in:
parent
af362ab47d
commit
678e114af8
|
@ -1,4 +1,4 @@
|
|||
/target
|
||||
/tests
|
||||
**/*.rs.bk
|
||||
Cargo.lock
|
||||
/tests
|
||||
|
|
28
README.md
28
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)
|
10
src/lib.rs
10
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"),
|
||||
|
|
Loading…
Reference in New Issue