| Crates.io | my-rust-lib-1 |
| lib.rs | my-rust-lib-1 |
| version | 66.0.99 |
| created_at | 2025-12-26 07:56:40.660581+00 |
| updated_at | 2025-12-26 07:56:40.660581+00 |
| description | High-quality integration for https://supermaker.ai/ |
| homepage | https://supermaker.ai/ |
| repository | https://github.com/qy-upup/my-rust-lib-1 |
| max_upload_size | |
| id | 2005366 |
| size | 8,712 |
A versatile Rust library providing essential utilities for data manipulation and analysis. This crate offers a collection of functions designed to simplify common tasks, enhancing developer productivity.
To incorporate my-rust-lib-1 into your Rust project, add the following line to your Cargo.toml file under the [dependencies] section:
toml
my-rust-lib-1 = "0.1.0" # Replace with the latest version
Then, run cargo build to download and compile the crate.
Here are a few examples demonstrating how to use my-rust-lib-1 in your projects:
1. Calculating the Mean of a Vector:
This example showcases how to easily calculate the arithmetic mean of a vector of numbers. rust use my_rust_lib_1::stats;
fn main() { let data = vec![1.0, 2.0, 3.0, 4.0, 5.0]; let mean = stats::mean(&data);
match mean {
Some(value) => println!("The mean is: {}", value),
None => println!("The input vector is empty."),
}
}
2. Converting a String to Title Case:
This example demonstrates how to convert a string to title case, capitalizing the first letter of each word. rust use my_rust_lib_1::string_utils;
fn main() { let input_string = "this is a sample string"; let title_case_string = string_utils::to_title_case(input_string); println!("Title case: {}", title_case_string); }
3. Checking if a Number is Prime:
This example shows how to efficiently check if a given number is a prime number. rust use my_rust_lib_1::math;
fn main() { let number = 17; let is_prime = math::is_prime(number);
if is_prime {
println!("{} is a prime number", number);
} else {
println!("{} is not a prime number", number);
}
}
4. Finding the Maximum Value in a Vector (with Error Handling):
This example illustrates finding the maximum value within a vector and handling the potential case of an empty vector. rust use my_rust_lib_1::stats;
fn main() { let data = vec![10, 5, 20, 1, 15]; let max_value = stats::max(&data);
match max_value {
Some(max) => println!("The maximum value is: {}", max),
None => println!("The vector is empty."),
}
}
my-rust-lib-1 provides the following key features:
This crate is licensed under the MIT License. See the LICENSE file for more details.
This crate is part of the my-rust-lib-1 ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/