Skip to content

feat: add exercise involving lifetime elision#1719

Open
sgasse wants to merge 1 commit intorust-lang:mainfrom
sgasse:sgasse/feature/lifetime_elision_example
Open

feat: add exercise involving lifetime elision#1719
sgasse wants to merge 1 commit intorust-lang:mainfrom
sgasse:sgasse/feature/lifetime_elision_example

Conversation

@sgasse
Copy link
Copy Markdown

@sgasse sgasse commented Oct 14, 2023

No description provided.

@sgasse
Copy link
Copy Markdown
Author

sgasse commented Oct 14, 2023

Hey @shadows-withal ! Your talk yesterday at EuroRust inspired me to contribute this example 🙂 A colleague of mine asked for help with a much more cluttered real-life example of the same problem that he ran into. Hope it can be useful to others as well.

Comment thread exercises/lifetimes/lifetimes4.rs Outdated
Comment thread info.toml Outdated
@sgasse sgasse force-pushed the sgasse/feature/lifetime_elision_example branch from 0212875 to f3729f1 Compare October 16, 2023 18:31
@sgasse sgasse force-pushed the sgasse/feature/lifetime_elision_example branch from f3729f1 to 5adf590 Compare April 19, 2024 15:23
@sgasse
Copy link
Copy Markdown
Author

sgasse commented Apr 19, 2024

I integrated your suggestions and updated the wording to be more concrete. Could you take another look @shadows-withal ?

@sgasse

This comment was marked as outdated.

@mo8it

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@mo8it mo8it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this exercise. It needs to be adapted to version 6 by adding a solution, adapting the info in info.toml, adding TODOs and removing the hint about getting a hint and I AM DONE.

@mo8it mo8it added this to the v7 milestone Apr 13, 2026
@sgasse
Copy link
Copy Markdown
Author

sgasse commented Apr 13, 2026

OK nice, I will rebase and push an updated version 👍

@sgasse sgasse force-pushed the sgasse/feature/lifetime_elision_example branch from 5adf590 to 10a28ca Compare April 13, 2026 20:22
@sgasse
Copy link
Copy Markdown
Author

sgasse commented Apr 13, 2026

Thank you @mo8it for reading through this change - I recreated the example on top of latest main and adjusted to version 6 following your instructions. Could you check again please?

Also, I may be missing something obvious here, but I was not able to test following the suggestions from CONTRIBUTING.md. There it says:

Make sure your exercise runs with rustlings run yourTopicN

However, I get the following error in this case:

> rustlings run lifetimes4
Error: You are trying to run Rustlings using the old method before version 6.
The new method doesn't include cloning the Rustlings' repository.
Please follow the instructions in `README.md`:
https://github.com/rust-lang/rustlings#getting-started

Though cargo run -- run lifetimes4 and cargo run -- hint lifetimes4 work as expected so I hope the patch follows version 6 correctly. What is the best way to run rustlings with an updated state of the exercises? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants