Files
aho_corasick
ansi_term
array_tool
atty
bitflags
cargo_update
cfg_if
clap
app
args
completions
dirs
dirs_sys
form_urlencoded
git2
blame.rsblob.rsbranch.rsbuf.rsbuild.rscall.rscert.rscherrypick.rscommit.rsconfig.rscred.rsdescribe.rsdiff.rserror.rsindex.rslib.rsmerge.rsmessage.rsnote.rsobject.rsodb.rsoid.rsoid_array.rspackbuilder.rspanic.rspatch.rspathspec.rsproxy_options.rsrebase.rsreference.rsreflog.rsrefspec.rsremote.rsremote_callbacks.rsrepo.rsrevspec.rsrevwalk.rssignature.rsstash.rsstatus.rsstring_array.rssubmodule.rstag.rstime.rstransport.rstree.rstreebuilder.rsutil.rs
hex
idna
json
lazy_static
lazysort
libc
unix
libgit2_sys
libssh2_sys
libz_sys
log
matches
maybe_uninit
memchr
openssl_probe
openssl_sys
percent_encoding
proc_macro2
quote
regex
regex_syntax
ast
hir
unicode_tables
semver
semver_parser
serde
de
private
ser
serde_derive
smallvec
strsim
syn
attr.rsawait.rsbigint.rsbuffer.rscustom_keyword.rscustom_punctuation.rsdata.rsderive.rsdiscouraged.rserror.rsexport.rsexpr.rsext.rsgenerics.rsgroup.rsident.rslib.rslifetime.rslit.rslookahead.rsmac.rsmacros.rsop.rsparse.rsparse_macro_input.rsparse_quote.rspath.rsprint.rspunctuated.rssealed.rsspan.rsspanned.rsthread.rstoken.rsty.rsverbatim.rs
tabwriter
term_size
textwrap
toml
unicode_bidi
unicode_normalization
unicode_width
unicode_xid
url
vec_map
>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
use lib::*;
pub fn from_bounds<I>(iter: &I) -> Option<usize>
where
I: Iterator,
{
helper(iter.size_hint())
}
#[cfg(any(feature = "std", feature = "alloc"))]
#[inline]
pub fn cautious(hint: Option<usize>) -> usize {
cmp::min(hint.unwrap_or(0), 4096)
}
fn helper(bounds: (usize, Option<usize>)) -> Option<usize> {
match bounds {
(lower, Some(upper)) if lower == upper => Some(upper),
_ => None,
}
}