Skip to content

Commit 85c7def

Browse files
committed
Fix clippy lint on rust 1.91
``` Compiling ruby-prism v1.6.0 (/home/runner/work/prism/prism/rust/ruby-prism) error: implicitly cloning a `String` by calling `to_string` on its dereferenced type --> ruby-prism/build.rs:148:14 | 148 | _ => kind.to_string(), | ^^^^^^^^^^^^^^^^ help: consider using: `kind.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#implicit_clone = note: `-D clippy::implicit-clone` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::implicit_clone)]` ```
1 parent ac0d423 commit 85c7def

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rust/ruby-prism/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ fn struct_name(name: &str) -> String {
142142
result
143143
}
144144

145-
fn kind_to_type(kind: &String) -> String {
146-
match kind.as_str() {
145+
fn kind_to_type(kind: &str) -> String {
146+
match kind {
147147
"non-void expression" | "pattern expression" | "Node" => String::new(),
148-
_ => kind.to_string(),
148+
_ => kind.to_owned(),
149149
}
150150
}
151151

0 commit comments

Comments
 (0)