cargo fmt

This commit is contained in:
Philipp Hansch
2019-01-21 07:54:05 +01:00
parent f9d65b6356
commit c0a02691d8
5 changed files with 54 additions and 40 deletions

View File

@@ -354,11 +354,9 @@ pub fn method_chain_args<'a>(expr: &'a Expr, methods: &[&str]) -> Option<Vec<&'a
///
/// This is either the usual `main` function or a custom function with the `#[start]` attribute.
pub fn is_entrypoint_fn(fn_name: &str, attrs: &[ast::Attribute]) -> bool {
let is_custom_entrypoint = attrs.iter().any(|attr| {
attr.path.segments.len() == 1
&& attr.path.segments[0].ident.to_string() == "start"
});
let is_custom_entrypoint = attrs
.iter()
.any(|attr| attr.path.segments.len() == 1 && attr.path.segments[0].ident.to_string() == "start");
is_custom_entrypoint || fn_name == "main"
}