Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
yanganto committed Aug 9, 2024
1 parent 2fbeb44 commit 38fbb5d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions struct-patch-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct Field {

impl Patch {
/// Generate the token stream for the patch struct and it resulting implementations
pub fn to_token_stream(self) -> Result<TokenStream> {
pub fn to_token_stream(&self) -> Result<TokenStream> {
let Patch {
visibility,
struct_name,
Expand Down Expand Up @@ -352,7 +352,7 @@ trait ToStr {

impl ToStr for syn::Path {
fn to_string(&self) -> String {
self.to_token_stream().to_string()
self.into_token_stream().to_string()
}
}

Expand Down Expand Up @@ -423,8 +423,8 @@ mod tests {
};
let result = Patch::from_ast(syn::parse2(input).unwrap()).unwrap();
assert_eq_sorted!(
format!("{:?}", result.to_token_stream()),
format!("{:?}", expected.to_token_stream())
format!("{:?}", result.into_token_stream()),
format!("{:?}", expected.into_token_stream())
);
}
}

0 comments on commit 38fbb5d

Please sign in to comment.