Skip to content

Commit 2ca4ee2

Browse files
authored
Merge pull request #1460 from sagarvora/lifetimes-first
fix: move lifetimes above tests in recommended order
2 parents 09dc705 + b1fb38e commit 2ca4ee2

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

info.toml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,33 @@ hint = """
748748
To find the best solution to this challenge you're going to need to think back to your
749749
knowledge of traits, specifically Trait Bound Syntax - you may also need this: `use std::fmt::Display;`."""
750750

751+
# LIFETIMES
752+
753+
[[exercises]]
754+
name = "lifetimes1"
755+
path = "exercises/lifetimes/lifetimes1.rs"
756+
mode = "compile"
757+
hint = """
758+
Let the compiler guide you. Also take a look at the book if you need help:
759+
https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html"""
760+
761+
[[exercises]]
762+
name = "lifetimes2"
763+
path = "exercises/lifetimes/lifetimes2.rs"
764+
mode = "compile"
765+
hint = """
766+
Remember that the generic lifetime 'a will get the concrete lifetime that is equal to the smaller of the lifetimes of x and y.
767+
You can take at least two paths to achieve the desired result while keeping the inner block:
768+
1. Move the string2 declaration to make it live as long as string1 (how is result declared?)
769+
2. Move println! into the inner block"""
770+
771+
[[exercises]]
772+
name = "lifetimes3"
773+
path = "exercises/lifetimes/lifetimes3.rs"
774+
mode = "compile"
775+
hint = """
776+
If you use a lifetime annotation in a struct's fields, where else does it need to be added?"""
777+
751778
# TESTS
752779

753780
[[exercises]]
@@ -780,33 +807,6 @@ You can call a function right where you're passing arguments to `assert!` -- so
780807
something like `assert!(having_fun())`. If you want to check that you indeed get false, you
781808
can negate the result of what you're doing using `!`, like `assert!(!having_fun())`."""
782809

783-
# LIFETIMES
784-
785-
[[exercises]]
786-
name = "lifetimes1"
787-
path = "exercises/lifetimes/lifetimes1.rs"
788-
mode = "compile"
789-
hint = """
790-
Let the compiler guide you. Also take a look at the book if you need help:
791-
https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html"""
792-
793-
[[exercises]]
794-
name = "lifetimes2"
795-
path = "exercises/lifetimes/lifetimes2.rs"
796-
mode = "compile"
797-
hint = """
798-
Remember that the generic lifetime 'a will get the concrete lifetime that is equal to the smaller of the lifetimes of x and y.
799-
You can take at least two paths to achieve the desired result while keeping the inner block:
800-
1. Move the string2 declaration to make it live as long as string1 (how is result declared?)
801-
2. Move println! into the inner block"""
802-
803-
[[exercises]]
804-
name = "lifetimes3"
805-
path = "exercises/lifetimes/lifetimes3.rs"
806-
mode = "compile"
807-
hint = """
808-
If you use a lifetime annotation in a struct's fields, where else does it need to be added?"""
809-
810810
# STANDARD LIBRARY TYPES
811811

812812
[[exercises]]

0 commit comments

Comments
 (0)