MCPcopy Index your code
hub / github.com/RustPython/RustPython / from_str

Method from_str

src/settings.rs:27–33  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

25 type Err = &'static str;
26
27 fn from_str(s: &str) -> Result<Self, Self::Err> {
28 match s {
29 "ensurepip" => Ok(Self::Ensurepip),
30 "get-pip" => Ok(Self::GetPip),
31 _ => Err("--install-pip takes ensurepip or get-pip as first argument"),
32 }
33 }
34}
35
36#[derive(Default)]

Callers

nothing calls this directly

Calls 1

ErrClass · 0.50

Tested by

no test coverage detected