Skip to main content

is_existence_wildcard_str

Function is_existence_wildcard_str 

Source
pub fn is_existence_wildcard_str(req: &str) -> bool
Expand description

is_existence_wildcard for a raw &str, without allocating a VersionReq wrapper.

Exists for callers that hold a version requirement as &str rather than a VersionReq (e.g. an inherent method taking req_str: &str for its own parsing needs) — going through is_existence_wildcard there would allocate a String via VersionReq::new on every call just to check it.

§Examples

use deps_core::registry::is_existence_wildcard_str;

assert!(is_existence_wildcard_str("*"));
assert!(is_existence_wildcard_str(""));
assert!(!is_existence_wildcard_str("^1.2"));