chore: make clippy happy
This commit is contained in:
1 parent
fcbd260f1a
commit
2884d72b08
10 files changed
+42
-50
No files matched your search
@@ -124,9 +124,9 @@ impl ToTokens for CapturedContextBuilder {
|
||||
let expr = segment.to_token_stream();
|
||||
let as_string = expr.to_string();
|
||||
let format_expr = if format_args.is_empty() {
|
||||
"{".to_string() + &format_args + "}"
|
||||
"{".to_string() + format_args + "}"
|
||||
} else {
|
||||
"{".to_string() + ":" + &format_args + "}"
|
||||
"{".to_string() + ":" + format_args + "}"
|
||||
};
|
||||
Some(quote! {
|
||||
FormattedArg{
|
||||
|
||||
@@ -44,13 +44,13 @@ impl ParseError {
|
||||
impl Display for Error {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Error::ParseError(error) => write!(
|
||||
Error::ParseError(error) => writeln!(
|
||||
f,
|
||||
"parse error:\n--> at {}:{}:{}\n\t{:?}\n",
|
||||
"parse error:\n--> at {}:{}:{}\n\t{:?}",
|
||||
error.location.file_path, error.location.line, error.location.column, error.message
|
||||
),
|
||||
Error::RecompileRequiredError(reason) => {
|
||||
write!(f, "recompile required: {:?}\n", reason)
|
||||
writeln!(f, "recompile required: {:?}", reason)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ fn resolve_ifmt(ifmt: &IfmtInput, captured: &IfmtArgs) -> Result<String, Error>
|
||||
}
|
||||
}
|
||||
}
|
||||
Segment::Literal(lit) => result.push_str(&lit),
|
||||
Segment::Literal(lit) => result.push_str(lit),
|
||||
}
|
||||
}
|
||||
Ok(result)
|
||||
@@ -119,21 +119,16 @@ fn build_node<'a>(
|
||||
is_volatile: false,
|
||||
namespace,
|
||||
});
|
||||
} else if literal {
|
||||
// literals will be captured when a full recompile is triggered
|
||||
return Err(Error::RecompileRequiredError(
|
||||
RecompileReason::CapturedAttribute(name.to_string()),
|
||||
));
|
||||
} else {
|
||||
if literal {
|
||||
// literals will be captured when a full recompile is triggered
|
||||
return Err(Error::RecompileRequiredError(
|
||||
RecompileReason::CapturedAttribute(name.to_string()),
|
||||
));
|
||||
} else {
|
||||
return Err(Error::ParseError(ParseError::new(
|
||||
syn::Error::new(
|
||||
span,
|
||||
format!("unknown attribute: {}", name),
|
||||
),
|
||||
ctx.location.clone(),
|
||||
)));
|
||||
}
|
||||
return Err(Error::ParseError(ParseError::new(
|
||||
syn::Error::new(span, format!("unknown attribute: {}", name)),
|
||||
ctx.location.clone(),
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,21 +159,19 @@ fn build_node<'a>(
|
||||
is_volatile: false,
|
||||
namespace,
|
||||
});
|
||||
} else if literal {
|
||||
// literals will be captured when a full recompile is triggered
|
||||
return Err(Error::RecompileRequiredError(
|
||||
RecompileReason::CapturedAttribute(name.to_string()),
|
||||
));
|
||||
} else {
|
||||
if literal {
|
||||
// literals will be captured when a full recompile is triggered
|
||||
return Err(Error::RecompileRequiredError(
|
||||
RecompileReason::CapturedAttribute(name.to_string()),
|
||||
));
|
||||
} else {
|
||||
return Err(Error::ParseError(ParseError::new(
|
||||
syn::Error::new(
|
||||
span,
|
||||
format!("unknown attribute: {}", name),
|
||||
),
|
||||
ctx.location.clone(),
|
||||
)));
|
||||
}
|
||||
return Err(Error::ParseError(ParseError::new(
|
||||
syn::Error::new(
|
||||
span,
|
||||
format!("unknown attribute: {}", name),
|
||||
),
|
||||
ctx.location.clone(),
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ pub fn resolve_scope<'a>(
|
||||
}
|
||||
}
|
||||
|
||||
fn interpert_rsx<'a, 'b>(
|
||||
fn interpert_rsx<'a>(
|
||||
factory: dioxus_core::NodeFactory<'a>,
|
||||
text: &str,
|
||||
context: captuered_context::CapturedContext<'a>,
|
||||
|
||||
Reference in new issue
Block a user