MCPcopy Create free account
hub / github.com/Noumena-Network/code / parse_python_version

Function parse_python_version

rust/py_repl_host/src/main.rs:376–386  ·  view source on GitHub ↗
(input: &str)

Source from the content-addressed store, hash-verified

374}
375
376fn parse_python_version(input: &str) -> Option<Vec<u32>> {
377 let mut parts = Vec::new();
378 for segment in input.split('.') {
379 let value = segment.trim().parse::<u32>().ok()?;
380 parts.push(value);
381 }
382 if parts.len() < 3 {
383 return None;
384 }
385 Some(parts)
386}
387
388fn compare_version(left: &[u32], right: &[u32]) -> i32 {
389 let length = left.len().max(right.len());

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected