MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / optional_c_string

Function optional_c_string

packages/server/src/native/bridge.rs:875–879  ·  view source on GitHub ↗
(value: Option<&str>)

Source from the content-addressed store, hash-verified

873}
874
875fn optional_c_string(value: Option<&str>) -> Result<Option<CString>, AppError> {
876 value
877 .map(|value| CString::new(value).map_err(|e| AppError::bad_request(e.to_string())))
878 .transpose()
879}
880
881fn optional_c_ptr(value: &Option<CString>) -> *const c_char {
882 value.as_ref().map_or(ptr::null(), |value| value.as_ptr())

Callers 1

create_simulatorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected