Skip to content

Commit

Permalink
Remove usless checks
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryAstafyev committed Nov 20, 2023
1 parent 950dbd5 commit c71d0d3
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ use syn::{
};
pub use target::Target;

const ATTR_ALIAS: &str = "tslink";

#[derive(Clone, Debug, Default)]
pub struct Context {
pub inputs: Vec<Input>,
Expand Down Expand Up @@ -215,19 +213,14 @@ impl Context {

pub fn try_from_or_default(attrs: &[Attribute]) -> Result<Self, E> {
for attr in attrs.iter() {
if let (true, Some(ident)) = (
matches!(attr.style, AttrStyle::Outer),
attr.path().get_ident(),
) {
if ident == ATTR_ALIAS {
if matches!(attr.meta, Meta::Path(_)) {
// No attributes
continue;
}
return attr
.parse_args_with(Context::parse)
.map_err(|e| E::PasringContext(e.to_string()));
if matches!(attr.style, AttrStyle::Outer) {
if matches!(attr.meta, Meta::Path(_)) {
// No attributes
continue;
}
return attr
.parse_args_with(Context::parse)
.map_err(|e| E::PasringContext(e.to_string()));
}
}
Ok(Self::default())
Expand Down

0 comments on commit c71d0d3

Please sign in to comment.