MCPcopy Create free account
hub / github.com/astral-sh/ruff / try_from

Method try_from

crates/ruff_python_ast/src/python_version.rs:115–121  ·  view source on GitHub ↗
(value: (i64, i64))

Source from the content-addressed store, hash-verified

113 type Error = std::num::TryFromIntError;
114
115 fn try_from(value: (i64, i64)) -> Result<Self, Self::Error> {
116 let (major, minor) = value;
117 Ok(Self {
118 major: u8::try_from(major)?,
119 minor: u8::try_from(minor)?,
120 })
121 }
122}
123
124impl fmt::Display for PythonVersion {

Callers

nothing calls this directly

Calls 3

OkClass · 0.85
map_errMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected