MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / parse_version_tuple

Function parse_version_tuple

dstack-mr/src/machine.rs:41–53  ·  view source on GitHub ↗
(v: &str)

Source from the content-addressed store, hash-verified

39}
40
41fn parse_version_tuple(v: &str) -> Result<(u32, u32, u32)> {
42 let parts: Vec<u32> = v
43 .split('.')
44 .map(|p| p.parse::<u32>().context("Invalid version number"))
45 .collect::<Result<Vec<_>, _>>()?;
46 if parts.len() != 3 {
47 bail!(
48 "Version string must have exactly 3 parts (major.minor.patch), got {}",
49 parts.len()
50 );
51 }
52 Ok((parts[0], parts[1], parts[2]))
53}
54
55impl Machine<'_> {
56 pub fn versioned_options(&self) -> Result<VersionedOptions> {

Callers 1

versioned_optionsMethod · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected