diff --git a/README.md b/README.md index 9d8257a..0eac76e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,17 @@ # cstring-array -[![CI](https://github.com/RAprogramm/cstring-array/workflows/CI/badge.svg)](https://github.com/RAprogramm/cstring-array/actions) -[![codecov](https://codecov.io/gh/RAprogramm/cstring-array/graph/badge.svg?token=7qIC3Impoa)](https://codecov.io/gh/RAprogramm/cstring-array) [![Crates.io](https://img.shields.io/crates/v/cstring-array.svg)](https://crates.io/crates/cstring-array) +[![Downloads](https://img.shields.io/crates/d/cstring-array.svg)](https://crates.io/crates/cstring-array) [![Documentation](https://docs.rs/cstring-array/badge.svg)](https://docs.rs/cstring-array) -[![Hits-of-Code](https://hitsofcode.com/github/RAprogramm/cstring-array?branch=main)](https://hitsofcode.com/view/github/RAprogramm/cstring-array?branch=main) +[![Lib.rs](https://img.shields.io/badge/lib.rs-cstring--array-blue)](https://lib.rs/crates/cstring-array) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) + +[![CI](https://github.com/RAprogramm/cstring-array/workflows/CI/badge.svg)](https://github.com/RAprogramm/cstring-array/actions) +[![codecov](https://codecov.io/gh/RAprogramm/cstring-array/graph/badge.svg?token=7qIC3Impoa)](https://codecov.io/gh/RAprogramm/cstring-array) [![REUSE status](https://api.reuse.software/badge/github.com/RAprogramm/cstring-array)](https://api.reuse.software/info/github.com/RAprogramm/cstring-array) + [![Rust Version](https://img.shields.io/badge/rust-1.90%2B-blue.svg)](https://www.rust-lang.org) +[![Hits-of-Code](https://hitsofcode.com/github/RAprogramm/cstring-array?branch=main)](https://hitsofcode.com/view/github/RAprogramm/cstring-array?branch=main) **Safe, zero-copy wrapper for passing string arrays to C FFI (`char**`)** diff --git a/examples/command_line.rs b/examples/command_line.rs index 3676288..15bf4a5 100644 --- a/examples/command_line.rs +++ b/examples/command_line.rs @@ -9,7 +9,7 @@ //! - Simulating a C function that takes char** argv //! - Real-world usage pattern -use std::ffi::{c_char, c_int, CStr}; +use std::ffi::{CStr, c_char, c_int}; use cstring_array::CStringArray; @@ -57,7 +57,7 @@ fn main() { s if s.starts_with("--") => println!(" Option: {}", s), s if s.starts_with('-') => println!(" Flag: {}", s), s if i == 0 => println!(" Program: {}", s), - s => println!(" Argument: {}", s), + s => println!(" Argument: {}", s) } } } diff --git a/examples/zero_copy.rs b/examples/zero_copy.rs index eab057c..e751552 100644 --- a/examples/zero_copy.rs +++ b/examples/zero_copy.rs @@ -54,7 +54,10 @@ fn main() { println!(" Created {} CStrings", large_cstrings.len()); let large_array = CStringArray::from_cstrings(large_cstrings).expect("Failed to create array"); println!(" Zero-copy array length: {}", large_array.len()); - println!(" First element: {}", large_array.get(0).unwrap().to_str().unwrap()); + println!( + " First element: {}", + large_array.get(0).unwrap().to_str().unwrap() + ); println!( " Last element: {}", large_array