Skip to content

Commit fa801bd

Browse files
committed
feat: update module 1 challenge
1 parent 723ec31 commit fa801bd

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

docs/docs/module1/5_challenge.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,17 @@ sidebar_position: 5
77
Now it's time for you to take your first steps with Rust! Here's a challenge to get you started:
88

99
1. Initialize a Rust application in a brand new directory
10+
- If you have cloned the [GitHub repository](github.com/jeastham1993/rust-for-dotnet-devs-workshop) there is a folder called `scratch` which contains ` devcontainers.json` file. You can use this to launch a devcontainer for Rust development, as well as working through all the examples and challenges.
1011
2. Open the `src/main.rs` file in your editor and modify the "Hello, world!" message to include your name.
1112
3. Run the application to see your changes
1213
4. Try adding a second line to the program that prints the current date and time.
1314

14-
Hint: You'll need to add the `chrono` crate to your dependencies:
15-
```sh
16-
cargo add chrono
17-
```
18-
19-
And chrono has a method called `Local::now()`
20-
21-
```rust showLineNumbers
22-
let time_now = Local::now();
23-
```
15+
Hint: You'll need to add the `chrono` crate to your dependencies, and the [documentation](https://docs.rs/chrono/latest/chrono/) should help you find the functions you need.
2416

2517
5. Run the application again to see both lines printed.
2618

2719
Congratulations! You've written, modified, and run your first Rust program, and you've learned how to add and use external dependencies. In the next module, we'll dive deeper into Rust's memory safety features and how they compare to .NET.
2820

2921
Remember: the Rust compiler is your friend. If you get error messages, read them carefully - they often tell you exactly what's wrong and how to fix it!
3022

31-
The starter code for this challenge is [available on GitHub](https://github.com/jeastham1993/rust-for-dotnet-devs-workshop/tree/main/src/examples/module1/rust_app).
32-
3323
If you're struggling, you can find [a solution on GitHub](https://github.com/jeastham1993/rust-for-dotnet-devs-workshop/tree/main/src/solutions/module1/rust_app). Try it on your own first, if you're finding it difficult that's good. It means you're learning.

0 commit comments

Comments
 (0)