From 4547b622d8d29df964fa2914213088b148c498fc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:32 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/unic-langid-impl/src/bin/generate_likelysubtags.rs | 3 +-- vendor/unic-langid-impl/src/subtags/language.rs | 6 +++--- vendor/unic-langid-impl/src/subtags/region.rs | 4 ++-- vendor/unic-langid-impl/src/subtags/script.rs | 4 ++-- vendor/unic-langid-impl/src/subtags/variant.rs | 6 +++--- 5 files changed, 11 insertions(+), 12 deletions(-) (limited to 'vendor/unic-langid-impl/src') diff --git a/vendor/unic-langid-impl/src/bin/generate_likelysubtags.rs b/vendor/unic-langid-impl/src/bin/generate_likelysubtags.rs index 4fec79939..a86ffa80d 100644 --- a/vendor/unic-langid-impl/src/bin/generate_likelysubtags.rs +++ b/vendor/unic-langid-impl/src/bin/generate_likelysubtags.rs @@ -1,6 +1,5 @@ use serde_json::Value; use std::fs; -use std::str::FromStr; use tinystr::TinyStr8; use unic_langid_impl::{subtags, LanguageIdentifier}; @@ -77,7 +76,7 @@ fn main() { match (lang, script, region) { (None, None, None) => lang_only.push(( - TinyStr8::from_str("und").unwrap().into(), + u64::from_le_bytes(*TinyStr8::from_str("und").unwrap().all_bytes()), (val_lang, val_script, val_region), )), (Some(l), None, None) => lang_only.push(( diff --git a/vendor/unic-langid-impl/src/subtags/language.rs b/vendor/unic-langid-impl/src/subtags/language.rs index 3703475e2..8b25bb609 100644 --- a/vendor/unic-langid-impl/src/subtags/language.rs +++ b/vendor/unic-langid-impl/src/subtags/language.rs @@ -34,7 +34,7 @@ impl Language { /// This function accepts any u64 that is exected to be a valid /// `TinyStr8` and a valid `Language` subtag. pub const unsafe fn from_raw_unchecked(v: u64) -> Self { - Self(Some(TinyStr8::new_unchecked(v))) + Self(Some(TinyStr8::from_bytes_unchecked(v.to_le_bytes()))) } pub fn matches>( @@ -59,13 +59,13 @@ impl Language { impl From for Option { fn from(input: Language) -> Self { - input.0.map(|i| i.into()) + input.0.map(|i| u64::from_le_bytes(*i.all_bytes())) } } impl From<&Language> for Option { fn from(input: &Language) -> Self { - input.0.map(|i| i.into()) + input.0.map(|i| u64::from_le_bytes(*i.all_bytes())) } } diff --git a/vendor/unic-langid-impl/src/subtags/region.rs b/vendor/unic-langid-impl/src/subtags/region.rs index f14ac21bf..b7febe202 100644 --- a/vendor/unic-langid-impl/src/subtags/region.rs +++ b/vendor/unic-langid-impl/src/subtags/region.rs @@ -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 for u32 { fn from(input: Region) -> Self { - input.0.into() + u32::from_le_bytes(*input.0.all_bytes()) } } diff --git a/vendor/unic-langid-impl/src/subtags/script.rs b/vendor/unic-langid-impl/src/subtags/script.rs index 63780e510..8cb38c8d5 100644 --- a/vendor/unic-langid-impl/src/subtags/script.rs +++ b/vendor/unic-langid-impl/src/subtags/script.rs @@ -25,13 +25,13 @@ impl Script { /// This function accepts any u64 that is exected to be a valid /// `TinyStr4` and a valid `Script` 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