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

Method try_from

crates/ruff_python_formatter/src/string/mod.rs:63–69  ·  view source on GitHub ↗
(style: QuoteStyle)

Source from the content-addressed store, hash-verified

61 type Error = ();
62
63 fn try_from(style: QuoteStyle) -> Result<Quote, ()> {
64 match style {
65 QuoteStyle::Single => Ok(Quote::Single),
66 QuoteStyle::Double => Ok(Quote::Double),
67 QuoteStyle::Preserve => Err(()),
68 }
69 }
70}
71
72impl From<Quote> for QuoteStyle {

Callers

nothing calls this directly

Calls 1

OkClass · 0.85

Tested by

no test coverage detected