Skip to content

ludndev/rustlang-hello-world-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello World : A RustLang library

This Rust project provides a simple greeting function that greets a person by name or defaults to "Hello World!" if no name is provided.

Usage

To use this library in your Rust project, add it as a dependency in your Cargo.toml:

[dependencies]
ludndev-hello-world = "0.1.0"

Then, you can use it in your code:

use ludndev-hello-world::greet;

fn main() {
    let name = "John";
    let greeting = greet(name);
    println!("{}", greeting);
}

API

greet(name: &str) -> String

This function takes a name as input and returns a greeting message. If the name is empty, it defaults to "Hello World!".

Examples

use ludndev-hello-world::greet;

fn main() {
    let name = "Alice";
    let greeting = greet(name);
    assert_eq!(greeting, "Hello Alice !");
}

License

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

Author

This project was authored by Judicaël AHYI.

About

Hello World : A RustLang library

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy