saytify

Crates.iosaytify
lib.rssaytify
version0.3.0
created_at2025-12-25 03:52:29.777774+00
updated_at2025-12-25 04:31:19.787884+00
descriptionA simple library for greeting and farewell messages
homepagehttps://github.com/yourusername/greetify
repositoryhttps://github.com/yourusername/greetify
max_upload_size
id2004137
size5,566
Oki Fisthu Sasongko (fisthu)

documentation

https://docs.rs/greetify

README

saytify

A simple Rust library for greeting and farewell messages with automatic whitespace trimming.

Features

  • Simple greeting functions with say_hi() and say_goodbye()
  • Automatic whitespace trimming for clean output
  • Unicode support
  • Zero dependencies
  • Comprehensive test coverage

Installation

Add this to your Cargo.toml:

[dependencies]
saytify = "0.1.0"

Usage

use saytify::{say_hi, say_goodbye};

fn main() {
    // Basic usage
    println!("{}", say_hi("World"));        // "Hello, World!"
    println!("{}", say_goodbye("Alice"));   // "Goodbye, Alice!"
    
    // With automatic whitespace trimming
    println!("{}", say_hi("  Bob  "));      // "Hello, Bob!"
    println!("{}", say_goodbye(" "));       // "Goodbye, !"
    
    // Unicode support
    println!("{}", say_hi("José"));         // "Hello, José!"
}

API Reference

say_hi(name: &str) -> String

Creates a greeting message with the provided name.

Parameters:

  • name - The name to include in the greeting (automatically trimmed)

Returns:

  • A formatted greeting string

say_goodbye(name: &str) -> String

Creates a farewell message with the provided name.

Parameters:

  • name - The name to include in the farewell (automatically trimmed)

Returns:

  • A formatted farewell string

Examples

use saytify::{say_hi, say_goodbye};

// Normal usage
assert_eq!(say_hi("World"), "Hello, World!");
assert_eq!(say_goodbye("Alice"), "Goodbye, Alice!");

// Whitespace handling
assert_eq!(say_hi("  Bob  "), "Hello, Bob!");
assert_eq!(say_goodbye(" "), "Goodbye, !");

// Special characters
assert_eq!(say_hi("Alice&Bob"), "Hello, Alice&Bob!");
assert_eq!(say_goodbye("José"), "Goodbye, José!");

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Changelog

0.1.0

  • Initial release
  • Added say_hi() and say_goodbye() functions
  • Automatic whitespace trimming
  • Comprehensive test suite
Commit count: 0

cargo fmt