mirror of
https://github.com/Zenithsiz/zbuild.git
synced 2026-02-03 05:57:09 +00:00
ArcStr now implements From<&str>.
This commit is contained in:
parent
5a2c251b9b
commit
5176d20ab7
@ -812,7 +812,7 @@ mod tests {
|
||||
];
|
||||
|
||||
for (input, expected_ast) in cases {
|
||||
let mut parser = Parser::new(ArcStr::from(input.to_owned()));
|
||||
let mut parser = Parser::new(input.into());
|
||||
let ast = Ast::parse_from(&mut parser)
|
||||
.unwrap_or_else(|err| panic!("Unable to parse input {input:?}: {}", err.pretty()));
|
||||
assert_eq!(ast, expected_ast, "Ast differed for {input:?}");
|
||||
|
||||
@ -163,6 +163,12 @@ impl Borrow<str> for ArcStr {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&'_ str> for ArcStr {
|
||||
fn from(s: &str) -> Self {
|
||||
Self::from(s.to_owned())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for ArcStr {
|
||||
fn from(s: String) -> Self {
|
||||
Self::from(Arc::new(s))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user