MCPcopy Create free account
hub / github.com/OpenActionAPI/rust-elgato-streamdeck / extract_str

Function extract_str

src/util.rs:44–46  ·  view source on GitHub ↗

Extracts string from byte array, removing \0 symbols

(bytes: &[u8])

Source from the content-addressed store, hash-verified

42
43/// Extracts string from byte array, removing \0 symbols
44pub fn extract_str(bytes: &[u8]) -> Result<String, Utf8Error> {
45 Ok(from_utf8(bytes)?.replace('\0', "").to_string())
46}
47
48/// Flips key index horizontally, for use with Original v1 Stream Deck
49pub fn flip_key_index(kind: &Kind, key: u8) -> u8 {

Callers 2

serial_numberMethod · 0.85
firmware_versionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected