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

Method bom

atomic-core/src/change/encoding.rs:181–189  ·  view source on GitHub ↗

Get the BOM bytes for this encoding, if applicable. # Returns The BOM bytes, or an empty slice for encodings without BOM.

(&self)

Source from the content-addressed store, hash-verified

179 ///
180 /// The BOM bytes, or an empty slice for encodings without BOM.
181 pub fn bom(&self) -> &'static [u8] {
182 match self {
183 Encoding::Utf8 => &[], // UTF-8 BOM is optional, we don't add it
184 Encoding::Utf16Le => &[0xFF, 0xFE],
185 Encoding::Utf16Be => &[0xFE, 0xFF],
186 Encoding::Latin1 => &[],
187 Encoding::Binary => &[],
188 }
189 }
190
191 /// Get the canonical name of this encoding.
192 ///

Callers 1

skip_bomMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected