New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning: unused borrow must be used #233
Comments
Hi everybody ! |
@Roms1383 Can you explain the case to me? |
Yes @botika, sure: platformcontext
sample of code#[derive(Template)] // ⚠️ unused borrow that must be used the borrow produces a value
#[template(path = "email-verification")]
pub struct EmailVerification<'a> {
url: &'a str,
name: &'a str,
is_applying: bool,
code: &'a str,
expiration: &'a str,
} sample of template📁 ./templates/email-verification.hbs {{#if code == "fr"}}
{{> fr/email-verification }}
{{else}}
{{> en/email-verification }}
{{/if}} 📁 ./templates/en/email-verification.hbs {{name}}
Welcome, we have acknowledged your registration.
Please verify your email address by clicking on the link below.
{{{url}}}
This verification link will expire on {{expiration}}
Once expired, please process with registration from the beginning again.
Thank you. |
@Roms1383 The changes are already in master. Can you confirm that they have solved the problem to get a new version? |
@botika I tried quickly from |
Thank you very much for participating in the development of yarte, I release a new version throughout the morning (CET) (It's that I'm in a meeting now (don't tell my boss) 😺 ) |
As of recently, each time I compile my CLI app that uses Yarte i get a bunch of these:
Looking into it with
cargo expand
I see generated code like this:Which, as far as I understand, calls
__renders_it()
, and grabs the reference of the returnedResult
instead of grabbing the reference ofself.surface_type
, hence the warnings.The text was updated successfully, but these errors were encountered: