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

Function normalize_mirror

packages/server/src/camera.rs:389–397  ·  view source on GitHub ↗
(value: Option<&str>)

Source from the content-addressed store, hash-verified

387}
388
389fn normalize_mirror(value: Option<&str>) -> Result<String, AppError> {
390 let normalized = value.unwrap_or("auto").trim().to_ascii_lowercase();
391 match normalized.as_str() {
392 "auto" | "on" | "off" => Ok(normalized),
393 _ => Err(AppError::bad_request(
394 "Camera mirror must be one of `auto`, `on`, or `off`.",
395 )),
396 }
397}
398
399fn validate_udid(udid: &str) -> Result<(), AppError> {
400 if udid.trim().is_empty() || udid.contains('/') || udid.contains('\0') {

Callers 2

start_cameraFunction · 0.85
switch_cameraFunction · 0.85

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected