MCPcopy Create free account
hub / github.com/PowerShell/DSC / fix_semver

Function fix_semver

lib/dsc-lib/src/discovery/mod.rs:206–212  ·  view source on GitHub ↗
(version: &str)

Source from the content-addressed store, hash-verified

204/// The fixed version requirements string.
205#[must_use]
206pub fn fix_semver(version: &str) -> String {
207 // Check if is semver, then if the first character is a number, then we prefix with =
208 if Version::parse(version).is_ok() && version.chars().next().is_some_and(|c| c.is_ascii_digit()) {
209 return format!("={version}");
210 }
211 version.to_string()
212}
213
214impl Default for Discovery {
215 fn default() -> Self {

Callers

nothing calls this directly

Calls 2

parseFunction · 0.50
nextMethod · 0.45

Tested by

no test coverage detected