Skip to content
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

crm example compile error. #1898

Closed
sjud opened this issue Jun 2, 2021 · 1 comment · Fixed by #1902
Closed

crm example compile error. #1898

sjud opened this issue Jun 2, 2021 · 1 comment · Fixed by #1902
Labels
A-examples Area: The examples bug

Comments

@sjud
Copy link
Contributor

sjud commented Jun 2, 2021

When building the crm example I get this error.

   --> src/add_client.rs:74:26
    |
73  |       fn view(&self) -> Html {
    |               ----- this data with an anonymous lifetime `'_`...
74  |           let Self { link, client, ..} = self;
    |                            ^^^^^^ ...is captured here...
75  | /         html! {
76  | |             <>
77  | |                 <div class="names">
78  | |                     <input
...   |
107 | |             </>
108 | |         }
    | |_________- ...and is required to live as long as `'static` here

Environment:

  • Yew version: v0.18
  • Rust version: 1.52.1
  • Build tool, if relevant: cargo check
  • OS, if relevant: MacOS

I fixed this by changing
&client.last_name -> client.last_name.clone()
&client.first_name -> client.first_name.clone()
&client.description -> client.description.clone()

I'm not sure if this is the solution, but if it is I'd be happy to make a pull request fixing the problem.
Thank you for great library.

@sjud sjud added the bug label Jun 2, 2021
@siku2 siku2 added the A-examples Area: The examples label Jun 3, 2021
@siku2
Copy link
Member

siku2 commented Jun 4, 2021

Feel free to open a PR with your changes, it certainly looks like that's the correct way to solve it

siku2 pushed a commit that referenced this issue Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-examples Area: The examples bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants