From 38fbb5d1325daec50d4189742d4852038a38f38a Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Sat, 10 Aug 2024 00:41:11 +0800 Subject: [PATCH] fix clippy --- struct-patch-derive/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/struct-patch-derive/src/lib.rs b/struct-patch-derive/src/lib.rs index 2b83e52..792a4aa 100644 --- a/struct-patch-derive/src/lib.rs +++ b/struct-patch-derive/src/lib.rs @@ -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 { + pub fn to_token_stream(&self) -> Result { let Patch { visibility, struct_name, @@ -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() } } @@ -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()) ); } }