fnichol_cime/lib.rs
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
5//! This crate executes a highly specialized algorithm to dynamically generate a greeting in
6//! english to a given subject. It is serious business.
7//!
8//! ## Usage
9//!
10//! This crate is on [crates.io](https://crates.io/crates/fnichol-cime) and can be used by adding
11//! the crate to your dependencies in your project's `Cargo.toml` file:
12//!
13//! ```toml
14//! [dependencies]
15//! fnichol-cime = { version = "0.7.0", default-features = false }
16//! ```
17//!
18//! Note that the default features include dependencies which are required to build a CLI and are
19//! not needed for the library.
20//!
21//! ## Examples
22//!
23//! ### Example: greeting a human
24//!
25//! Assuming we have a human named `Jane`:
26//!
27//! ```
28//! let greeting = fnichol_cime::greeting("Jane");
29//! // #=> "Hello, Jane!"
30//! ```
31
32#![doc(html_root_url = "https://docs.rs/fnichol-cime/0.7.0")]
33#![deny(missing_docs)]
34
35/// Generates a greeting for a given subject.
36pub fn greeting(subject: impl AsRef<str>) -> String {
37 format!("Hello, {}!", subject.as_ref())
38}