Skip to content

Commit

Permalink
1. Small corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
denisandroid committed Aug 15, 2019
1 parent 8f1672c commit 059aec8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Safe creation of “CStr” with zero cost at the compilation stage with checkin

# Use
```
#![feature(plugin)]
#![plugin(clucstr)]
Expand Down Expand Up @@ -67,9 +66,25 @@ fn my_function(num: usize, a: &'static CStr) {
}
```

# Panic
# EasyUse

```
#![feature(plugin)]
#![plugin(clucstr)]
use std::ffi::CStr;
fn main() {
let cstr = cstr!("My CSTR!");
//&CStr
assert_eq!(cstr.to_bytes(), b"My CSTR!");
assert_eq!(cstr.to_bytes_with_nul(), b"My CSTR!\0");
}
```

# Panic
```
#![feature(plugin)]
#![plugin(clucstr)]
Expand Down
20 changes: 18 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Safe creation of “CStr” with zero cost at the compilation stage with checkin
# Use
```
#![feature(plugin)]
#![plugin(clucstr)]
Expand Down Expand Up @@ -80,9 +79,26 @@ fn my_function(num: usize, a: &'static CStr) {
}
```
# Panic
# EasyUse
```
#![feature(plugin)]
#![plugin(clucstr)]
use std::ffi::CStr;
fn main() {
let cstr = cstr!("My CSTR!");
//&CStr
assert_eq!(cstr.to_bytes(), b"My CSTR!");
assert_eq!(cstr.to_bytes_with_nul(), b"My CSTR!\0");
}
```
# Panic
```
#![feature(plugin)]
#![plugin(clucstr)]
Expand Down

0 comments on commit 059aec8

Please sign in to comment.