Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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**`)**

Expand Down
4 changes: 2 additions & 2 deletions examples/command_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
}
}
}
5 changes: 4 additions & 1 deletion examples/zero_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down