File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ netcdf-derive = { workspace = true, optional = true }
30
30
bitflags = " 2.4.2"
31
31
libc = " 0.2.155"
32
32
mpi-sys = { workspace = true , optional = true }
33
- parking_lot = " 0.12.3"
34
33
35
34
[dev-dependencies ]
36
35
clap = { version = " 4.5.1" , features = [" derive" ] }
Original file line number Diff line number Diff line change
1
+ //! Set and get configuration variables
1
2
use std:: ffi:: { c_char, CStr , CString } ;
2
3
use std:: ops:: Deref ;
3
4
use std:: ptr:: NonNull ;
4
5
6
+ /// Set a key
5
7
pub fn set ( key : & str , value : & str ) -> crate :: error:: Result < ( ) > {
6
8
let key = CString :: new ( key) ?;
7
9
let value = CString :: new ( value) ?;
@@ -11,6 +13,7 @@ pub fn set(key: &str, value: &str) -> crate::error::Result<()> {
11
13
}
12
14
13
15
#[ derive( Debug ) ]
16
+ /// String with custom Drop implementations
14
17
pub struct OwnedString {
15
18
inner : NonNull < c_char > ,
16
19
}
@@ -30,6 +33,7 @@ impl Drop for OwnedString {
30
33
}
31
34
}
32
35
36
+ /// Get a key
33
37
pub fn get ( key : & str ) -> Option < OwnedString > {
34
38
let key = if let Ok ( key) = CString :: new ( key) {
35
39
key
You can’t perform that action at this time.
0 commit comments