Skip to content

Commit c378b18

Browse files
committed
fix cargo fmt
1 parent 59e0e70 commit c378b18

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ target/
99

1010
# Environment
1111
.env
12-
13-
.history

sqlx-macros/src/derives/attributes.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub struct SqlxContainerAttributes {
7070
pub struct SqlxChildAttributes {
7171
pub rename: Option<String>,
7272
pub default: bool,
73-
pub try_from:Option<Ident>,
73+
pub try_from: Option<Ident>,
7474
}
7575

7676
pub fn parse_container_attributes(input: &[Attribute]) -> syn::Result<SqlxContainerAttributes> {
@@ -208,7 +208,11 @@ pub fn parse_child_attributes(input: &[Attribute]) -> syn::Result<SqlxChildAttri
208208
}
209209
}
210210

211-
Ok(SqlxChildAttributes { rename, default,try_from })
211+
Ok(SqlxChildAttributes {
212+
rename,
213+
default,
214+
try_from,
215+
})
212216
}
213217

214218
pub fn check_transparent_attributes(

sqlx-macros/src/derives/row.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use syn::{
66
};
77

88
use super::{
9-
attributes::{parse_child_attributes, parse_container_attributes,SqlxChildAttributes},
9+
attributes::{parse_child_attributes, parse_container_attributes, SqlxChildAttributes},
1010
rename_all,
1111
};
1212

@@ -67,11 +67,12 @@ fn expand_derive_from_row_struct(
6767
for field in row_fields.iter() {
6868
let ty = &field.ty;
6969

70-
match &field.attrs.try_from{
71-
Some(try_from) =>{
72-
predicates.push(parse_quote!(#try_from: ::sqlx::decode::Decode<#lifetime, R::Database>));
70+
match &field.attrs.try_from {
71+
Some(try_from) => {
72+
predicates
73+
.push(parse_quote!(#try_from: ::sqlx::decode::Decode<#lifetime, R::Database>));
7374
predicates.push(parse_quote!(#try_from: ::sqlx::types::Type<R::Database>));
74-
},
75+
}
7576
None => {
7677
predicates.push(parse_quote!(#ty: ::sqlx::decode::Decode<#lifetime, R::Database>));
7778
predicates.push(parse_quote!(#ty: ::sqlx::types::Type<R::Database>));
@@ -176,7 +177,7 @@ fn expand_derive_from_row_struct_unnamed(
176177

177178
for field in fields {
178179
let ty = &field.ty;
179-
180+
180181
predicates.push(parse_quote!(#ty: ::sqlx::decode::Decode<#lifetime, R::Database>));
181182
predicates.push(parse_quote!(#ty: ::sqlx::types::Type<R::Database>));
182183
}
@@ -220,4 +221,4 @@ fn get_row_fields<'a>(
220221
})
221222
})
222223
.collect()
223-
}
224+
}

tests/mysql/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ pub mod test_for_attr_with {
388388

389389
#[derive(Debug, PartialEq)]
390390
struct Id(i64);
391-
impl std::convert::TryFrom<i64> for Id{
391+
impl std::convert::TryFrom<i64> for Id {
392392
type Error = std::io::Error;
393393
fn try_from(value: i64) -> Result<Self, Self::Error> {
394394
Ok(Id(value))

0 commit comments

Comments
 (0)