summaryrefslogtreecommitdiffstats
path: root/third_party/rust/os_str_bytes/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/os_str_bytes/src/util.rs')
-rw-r--r--third_party/rust/os_str_bytes/src/util.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/third_party/rust/os_str_bytes/src/util.rs b/third_party/rust/os_str_bytes/src/util.rs
new file mode 100644
index 0000000000..f931969c52
--- /dev/null
+++ b/third_party/rust/os_str_bytes/src/util.rs
@@ -0,0 +1,9 @@
+pub(super) const BYTE_SHIFT: u8 = 6;
+
+pub(super) const CONT_MASK: u8 = (1 << BYTE_SHIFT) - 1;
+
+pub(super) const CONT_TAG: u8 = 0b1000_0000;
+
+pub(super) const fn is_continuation(byte: u8) -> bool {
+ byte & !CONT_MASK == CONT_TAG
+}