]> git.proxmox.com Git - rustc.git/blobdiff - vendor/unic-langid-impl/src/subtags/region.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / vendor / unic-langid-impl / src / subtags / region.rs
index f14ac21bf63666d075834ee7b03cf6db75246650..b7febe2025e5281cc64d7a5f3573f4ddff288e4a 100644 (file)
@@ -37,13 +37,13 @@ impl Region {
     /// This function accepts any u64 that is exected to be a valid
     /// `TinyStr4` and a valid `Region` subtag.
     pub const unsafe fn from_raw_unchecked(v: u32) -> Self {
-        Self(TinyStr4::new_unchecked(v))
+        Self(TinyStr4::from_bytes_unchecked(v.to_le_bytes()))
     }
 }
 
 impl From<Region> for u32 {
     fn from(input: Region) -> Self {
-        input.0.into()
+        u32::from_le_bytes(*input.0.all_bytes())
     }
 }