Skip to content

Commit d48e4cd

Browse files
committed
remove unnecessary import prefix
1 parent ac8d518 commit d48e4cd

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

src/mapper_entry.rs

+12-17
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ impl MapperEntry {
155155

156156
//dto property is required and must be checked
157157
match dto_prop {
158-
Some(val) if utils::isblank(&val) => Err(syn::Error::new(
158+
Some(val) if isblank(&val) => Err(syn::Error::new(
159159
attr.span(),
160160
"`dto` property is blank. It must not have whitespace",
161161
)),
162162
None => Err(syn::Error::new(
163163
attr.span(),
164164
"`dto` property is missing.It is required for mapper",
165165
)),
166-
_ => syn::Result::Ok(mapper_entry),
166+
_ => Ok(mapper_entry),
167167
}
168168
}
169169

@@ -217,12 +217,7 @@ impl MapperEntry {
217217
let ignore_arr = Self::parse_array_of_string(expr_arr);
218218
//println!("{}={:?}",keyname, ignore_arr);
219219
//check if matt attribute is blank
220-
if ignore_arr
221-
.iter()
222-
.filter(|&text| utils::isblank(text))
223-
.count()
224-
> 0
225-
{
220+
if ignore_arr.iter().filter(|&text| isblank(text)).count() > 0 {
226221
panic!("`{}` attribute must not be blank", IGNORE);
227222
};
228223
mapper_entry.ignore = ignore_arr;
@@ -262,22 +257,22 @@ impl MapperEntry {
262257
if mapper_entry
263258
.map
264259
.iter()
265-
.filter(|&m_val| utils::isblank(&m_val.from_field))
260+
.filter(|&m_val| isblank(&m_val.from_field))
266261
.count()
267262
> 0
268263
{
269264
panic!("`{}` attribute must not be blank", MAP);
270265
};
271266
}
272267

273-
fn parse_array_of_macro_attr(expr_arr: &syn::ExprArray) -> Vec<String> {
268+
fn parse_array_of_macro_attr(expr_arr: &ExprArray) -> Vec<String> {
274269
let mut vec_tuple: Vec<String> = Vec::new();
275270

276271
for elem in expr_arr.elems.iter() {
277272
Self::process_macro_attr(&mut vec_tuple, elem);
278273
}
279274

280-
return vec_tuple;
275+
vec_tuple
281276
}
282277
fn process_macro_attr(vec_array: &mut Vec<String>, elem: &Expr) {
283278
if let Expr::Lit(content_lit) = elem {
@@ -291,7 +286,7 @@ impl MapperEntry {
291286
// eprintln!("elem={:#?}", elem);
292287
}
293288

294-
fn parse_array_of_tuple(expr_arr: &syn::ExprArray) -> Vec<MapTuple> {
289+
fn parse_array_of_tuple(expr_arr: &ExprArray) -> Vec<MapTuple> {
295290
let mut vec_tuple: Vec<(String, bool)> = Vec::new();
296291

297292
for elem in expr_arr.elems.iter() {
@@ -321,17 +316,17 @@ impl MapperEntry {
321316
}
322317
}
323318

324-
return vec_tuple;
319+
vec_tuple
325320
}
326321

327-
fn parse_array_of_new_fields(expr_arr: &syn::ExprArray) -> Vec<NewField> {
322+
fn parse_array_of_new_fields(expr_arr: &ExprArray) -> Vec<NewField> {
328323
let mut vec_tuple: Vec<NewField> = Vec::new();
329324

330325
for elem in expr_arr.elems.iter() {
331326
Self::process_new_fields(&mut vec_tuple, elem);
332327
}
333328

334-
return vec_tuple;
329+
vec_tuple
335330
}
336331

337332
fn process_new_fields(mut vec_tuple: &mut Vec<NewField>, elem: &Expr) {
@@ -428,7 +423,7 @@ impl MapperEntry {
428423
));
429424
}
430425

431-
fn parse_array_of_string(expr_arr: &syn::ExprArray) -> Vec<String> {
426+
fn parse_array_of_string(expr_arr: &ExprArray) -> Vec<String> {
432427
let mut vec_str: Vec<String> = Vec::new();
433428
for elem in expr_arr.elems.iter() {
434429
if let Expr::Lit(lit_expr) = elem {
@@ -439,7 +434,7 @@ impl MapperEntry {
439434
}
440435
}
441436
}
442-
return vec_str;
437+
vec_str
443438
}
444439
}
445440

0 commit comments

Comments
 (0)