Crates.io | txreqb2w |
lib.rs | txreqb2w |
version | 0.1.1 |
source | src |
created_at | 2023-06-20 11:50:10.71406 |
updated_at | 2023-06-20 11:53:46.23369 |
description | some description |
homepage | |
repository | |
max_upload_size | |
id | 895028 |
size | 5,875 |
crate_name
is a Rust crate that provides utility functions and enums for performing various operations.
Add the following line to your Cargo.toml
file:
[dependencies]
crate_name = "0.1.0"
use crate_name::add;
use crate_name::utils::Color;
fn main() {
let result = add(2, 2);
println!("Addition result: {}", result);
let color = Color::Red;
println!("Selected color: {:?}", color);
}
The crate provides the following functions:
add
Adds two numbers together and returns the result.
left
: The first number to be added.right
: The second number to be added.The sum of the two input numbers.
use crate_name::add;
let result = add(2, 3);
assert_eq!(result, 5);
The crate provides the following enum:
Color
An enum representing different colors.
Red
: The color red.Green
: The color green.Blue
: The color blue.use crate_name::utils::Color;
let color = Color::Red;
println!("Selected color: {:?}", color);
The crate includes unit tests for the add
function. You can run the tests using the following command:
cargo test
The tests ensure that the add
function correctly adds two numbers together.
This crate is distributed under the terms of the MIT license. See the LICENSE file for details.