MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / encoding_to_u8

Function encoding_to_u8

atomic-core/src/apply/file_ops.rs:973–982  ·  view source on GitHub ↗

Convert Encoding to u8 for storage.

(encoding: Option<&Encoding>)

Source from the content-addressed store, hash-verified

971
972/// Convert Encoding to u8 for storage.
973fn encoding_to_u8(encoding: Option<&Encoding>) -> u8 {
974 match encoding {
975 None => 0,
976 Some(Encoding::Utf8) => 1,
977 Some(Encoding::Utf16Le) => 2,
978 Some(Encoding::Utf16Be) => 3,
979 Some(Encoding::Binary) => 4,
980 Some(Encoding::Latin1) => 5,
981 }
982}
983
984// Low-Level Table Operations
985

Callers 3

apply_trunk_opFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected