rustlings

stackoverflow

Trouble implementing custom IntoIterator trait

CS-3210, Spring 2020

CS-3210, Spring 2020

rustlings

github.com/rust-lang/rustlings/, Small exercises to get you used to reading and writing Rust code!

This project contains small exercises to get you used to reading and writing Rust code.

PS C:\users\andreas\rustlings> Get-Command git
CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     git.exe                                            2.21.0.1   C:\Program Files\Git\cmd\git.exe


PS C:\users\andreas\rustlings> Get-Command rustc
CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     rustc.exe                                          0.0.0.0    C:\Users\andreas\.cargo\bin\rustc.exe

PS C:\users\andreas\rustlings> Get-Command cargo
CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     cargo.exe                                          0.0.0.0    C:\Users\andreas\.cargo\bin\cargo.exe
PS C:\WINDOWS\system32> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser                                                                                                                                                    Execution Policy Change                                                                                                 The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): y

PS C:\WINDOWS\system32> cd ../..
PS C:\> cd users
PS C:\users> cd andreas

PS C:\users\andreas> Start-BitsTransfer -Source https://raw.githubusercontent.com/rust-lang/rustlings/main/install.ps1 -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1
Let's get you set up with Rustlings!
Checking requirements...
SUCCESS: Git is installed
SUCCESS:  Rust is installed
SUCCESS: Cargo is installed
SUCCESS: Rust is up to date
Cloning Rustlings at C:\users\andreas/rustlings
Checking out version 5.3.0...
Installing the 'rustlings' executable...
  Installing rustlings v5.3.0 (C:\users\andreas\rustlings)
    Updating crates.io index
  Downloaded filetime v0.2.19
  Downloaded home v0.5.4
  Downloaded number_prefix v0.4.0
  Downloaded same-file v1.0.6
  Downloaded winapi-util v0.1.5
  Downloaded quote v1.0.23
  Downloaded proc-macro2 v1.0.49
  Downloaded serde v1.0.152
  Downloaded toml v0.5.10
  Downloaded serde_json v1.0.91
  Downloaded unicode-ident v1.0.6
  Downloaded serde_derive v1.0.152
  Downloaded argh v0.1.9
  Downloaded syn v1.0.107
  Downloaded regex v1.7.0
  Downloaded walkdir v2.3.2
  Downloaded encode_unicode v0.3.6
  Downloaded libc v0.2.139
  Downloaded argh_derive v0.1.9
  Downloaded regex-syntax v0.6.28
  Downloaded indicatif v0.16.2
  Downloaded argh_shared v0.1.9
  Downloaded ryu v1.0.12
  Downloaded glob v0.3.1
  Downloaded itoa v1.0.5
  Downloaded aho-corasick v0.7.20
  Downloaded notify v4.0.17
  Downloaded lazy_static v1.4.0
  Downloaded heck v0.4.0
  Downloaded console v0.15.4
  Downloaded 30 crates (2.4 MB) in 1.54s
   Compiling proc-macro2 v1.0.49
   Compiling quote v1.0.23
   Compiling unicode-ident v1.0.6
   Compiling syn v1.0.107
   Compiling windows_x86_64_msvc v0.42.0
   Compiling winapi v0.3.9
   Compiling memchr v2.5.0
   Compiling serde_derive v1.0.152
   Compiling libc v0.2.139
   Compiling serde v1.0.152
   Compiling regex-syntax v0.6.28
   Compiling heck v0.4.0
   Compiling argh_shared v0.1.9
   Compiling unicode-width v0.1.10
   Compiling lazy_static v1.4.0
   Compiling cfg-if v1.0.0
   Compiling encode_unicode v0.3.6
   Compiling serde_json v1.0.91
   Compiling bitflags v1.3.2
   Compiling ryu v1.0.12
   Compiling number_prefix v0.4.0
   Compiling itoa v1.0.5
   Compiling glob v0.3.1
   Compiling windows-sys v0.42.0
   Compiling aho-corasick v0.7.20
   Compiling filetime v0.2.19
   Compiling console v0.15.4
   Compiling regex v1.7.0
   Compiling winapi-util v0.1.5
   Compiling home v0.5.4
   Compiling indicatif v0.16.2
   Compiling same-file v1.0.6
   Compiling argh_derive v0.1.9
   Compiling walkdir v2.3.2
   Compiling argh v0.1.9
   Compiling notify v4.0.17
   Compiling toml v0.5.10
   Compiling rustlings v5.3.0 (C:\users\andreas\rustlings)
    Finished release [optimized] target(s) in 1m 07s
  Installing C:\Users\andreas\.cargo\bin\rustlings.exe
   Installed package `rustlings v5.3.0 (C:\users\andreas\rustlings)` (executable `rustlings.exe`)
All done! Run 'rustlings' to get started.
C:\Users\andreas\rustlings>rustlings

       welcome to...
                 _   _ _
  _ __ _   _ ___| |_| (_)_ __   __ _ ___
 | '__| | | / __| __| | | '_ \ / _` / __|
 | |  | |_| \__ \ |_| | | | | | (_| \__ \
 |_|   \__,_|___/\__|_|_|_| |_|\__, |___/
                               |___/

Thanks for installing Rustlings!

Is this your first time? Don't worry, Rustlings was made for beginners! We are
going to teach you a lot of things about Rust, but before we can get
started, here's a couple of notes about how Rustlings operates:

1. The central concept behind Rustlings is that you solve exercises. These
   exercises usually have some sort of syntax error in them, which will cause
   them to fail compilation or testing. Sometimes there's a logic error instead
   of a syntax error. No matter what error, it's your job to find it and fix it!
   You'll know when you fixed it because then, the exercise will compile and
   Rustlings will be able to move on to the next exercise.
2. If you run Rustlings in watch mode (which we recommend), it'll automatically
   start with the first exercise. Don't get confused by an error message popping
   up as soon as you run Rustlings! This is part of the exercise that you're
   supposed to solve, so open the exercise file in an editor and start your
   detective work!
3. If you're stuck on an exercise, there is a helpful hint you can view by typing
   'hint' (in watch mode), or running `rustlings hint exercise_name`.
4. If an exercise doesn't make sense to you, feel free to open an issue on GitHub!
   (https://github.com/rust-lang/rustlings/issues/new). We look at every issue,
   and sometimes, other learners do too so you can help each other out!
5. If you want to use `rust-analyzer` with exercises, which provides features like
   autocompletion, run the command `rustlings lsp`.

Got all that? Great! To get started, run `rustlings watch` in order to get the first
exercise. Make sure to have your editor open!

Leave a Reply

Your email address will not be published. Required fields are marked *