Skip to content

Commit

Permalink
Switch to Rust 2021 edition (#7)
Browse files Browse the repository at this point in the history
chore: switch to rust 2021 edition.
  • Loading branch information
jaudiger authored Mar 12, 2022
1 parent d772992 commit 08889f8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "lombok"
version = "0.3.3"
description = "Lombok port for Rust"
authors = ["sokomishalov <[email protected]>"]
edition = "2018"
edition = "2021"
readme = "README.md"
license = "MIT OR Apache-2.0"
repository = "https://github.com/sokomishalov/lombok-rs"
Expand Down
6 changes: 3 additions & 3 deletions src/equals_and_hash_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub(crate) fn equals_and_hash_code(input: TokenStream) -> TokenStream {
use std::hash::{Hash, Hasher};

impl #impl_generics #name #ty_generics #where_clause {
fn equals(&self, other: &#name#ty_generics) -> bool {
fn equals(&self, other: &#name #ty_generics) -> bool {
self.eq(&other)
}

Expand All @@ -74,7 +74,7 @@ pub(crate) fn equals_and_hash_code(input: TokenStream) -> TokenStream {
}

impl #impl_generics ::core::cmp::PartialEq for #name #ty_generics #where_clause {
fn eq(&self, other: &#name#ty_generics) -> bool {
fn eq(&self, other: &#name #ty_generics) -> bool {
match *other {
#name {
#(
Expand All @@ -94,7 +94,7 @@ pub(crate) fn equals_and_hash_code(input: TokenStream) -> TokenStream {
}
}

fn ne(&self, other: &TestNamedStructure#ty_generics) -> bool {
fn ne(&self, other: &#name #ty_generics) -> bool {
match *other {
#name {
#(
Expand Down
1 change: 0 additions & 1 deletion src/to_string.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use proc_macro::TokenStream;


use quote::{format_ident, quote};

use crate::utils::syn::{named_fields, parse_derive_input};
Expand Down
4 changes: 2 additions & 2 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct TestNamedStructure<'a> {
age: u8,
nick: &'a str,
languages: Vec<String>,
hobby: Box<String>,
hobby: Box<&'a str>,
}

#[cfg(test)]
Expand All @@ -42,7 +42,7 @@ mod tests {
*default.get_age_mut() = 10;
*default.get_nick_mut() = "another";
*default.get_languages_mut() = vec!["python".to_string()];
*default.get_hobby_mut() = Box::new("tennis".to_string());
*default.get_hobby_mut() = Box::new("tennis");

let copy = TestNamedStructure::default();

Expand Down

0 comments on commit 08889f8

Please sign in to comment.