From a990de90fe41456a23e58bd087d2f107d321f3a1 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 19 Jul 2024 16:37:58 +0400 Subject: Deleted vendor folder --- vendor/serde/src/de/size_hint.rs | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 vendor/serde/src/de/size_hint.rs (limited to 'vendor/serde/src/de/size_hint.rs') diff --git a/vendor/serde/src/de/size_hint.rs b/vendor/serde/src/de/size_hint.rs deleted file mode 100644 index 4a4fe25..0000000 --- a/vendor/serde/src/de/size_hint.rs +++ /dev/null @@ -1,29 +0,0 @@ -use crate::lib::*; - -pub fn from_bounds(iter: &I) -> Option -where - I: Iterator, -{ - helper(iter.size_hint()) -} - -#[cfg(any(feature = "std", feature = "alloc"))] -pub fn cautious(hint: Option) -> usize { - const MAX_PREALLOC_BYTES: usize = 1024 * 1024; - - if mem::size_of::() == 0 { - 0 - } else { - cmp::min( - hint.unwrap_or(0), - MAX_PREALLOC_BYTES / mem::size_of::(), - ) - } -} - -fn helper(bounds: (usize, Option)) -> Option { - match bounds { - (lower, Some(upper)) if lower == upper => Some(upper), - _ => None, - } -} -- cgit v1.2.3