Skip to content

Unable to find a solution to fn num_sq<T>(arg: &mut T) #1127

@CaliViking

Description

@CaliViking

For reference, see:

Related exercise:

fn num_sq<T>(arg: &mut T) {

Related unit test:

Related pull request (solves only part of the problem): #1113

Background information:

rustc --version
rustc 1.62.1 (e092d0b6b 2022-07-16)
rustlings --version 
v5.0.0
ls -la
total 7868
drwxr-xr-x  9 niels niels    4096 Aug  6 16:17 .
drwxrwxrwx 31 niels niels    4096 Aug  6 17:14 ..
-rw-r--r--  1 niels niels   36818 Aug  1 13:15 .all-contributorsrc
-rw-r--r--  1 niels niels     102 Aug  1 13:15 .editorconfig
drwxr-xr-x  8 niels niels    4096 Aug  5 19:38 .git
drwxr-xr-x  3 niels niels    4096 Aug  1 13:15 .github
-rw-r--r--  1 niels niels     139 Aug  1 13:15 .gitignore
-rw-r--r--  1 niels niels     150 Aug  1 13:15 .gitpod.yml
-rw-r--r--  1 niels niels     104 Aug  1 13:15 .replit
drwxr-xr-x  2 niels niels    4096 Aug  2 17:03 .vscode
-rw-r--r--  1 niels niels   44269 Aug  1 13:15 AUTHORS.md
-rw-r--r--  1 niels niels   41137 Aug  1 13:15 CHANGELOG.md
-rw-r--r--  1 niels niels    4171 Aug  1 13:15 CONTRIBUTING.md
-rw-r--r--  1 niels niels   16506 Aug  5 19:49 Cargo.lock
-rw-r--r--  1 niels niels     497 Aug  1 13:15 Cargo.toml
-rw-r--r--  1 niels niels    1095 Aug  1 13:15 LICENSE
-rw-r--r--  1 niels niels    5799 Aug  1 13:15 README.md
drwxr-xr-x 26 niels niels    4096 Aug  2 13:52 exercises
-rw-r--r--  1 niels niels   40537 Aug  1 13:15 info.toml
-rw-r--r--  1 niels niels    3022 Aug  1 13:15 install.ps1
-rwxr-xr-x  1 niels niels    4591 Aug  1 13:15 install.sh
-rw-r--r--  1 niels niels    8696 Aug  1 13:17 rust-project.json
drwxr-xr-x  2 niels niels    4096 Aug  1 13:15 src
drwxr-xr-x  4 niels niels    4096 Aug  5 19:49 target
-rwxr-xr-x  1 niels niels 3879296 Aug  2 22:55 temp_3632_ThreadId1
-rwxr-xr-x  1 niels niels 3879248 Aug  2 22:56 temp_9867_ThreadId1
drwxr-xr-x  3 niels niels    4096 Aug  1 13:15 tests
niels@DESKTOP-GU276AE:~/git/rustlings$

The observed issues:

It is not clear what the exercise is trying to teach

Please provide some context to the use case of passing u32 in a Box.

I can find no way to solve it

Are there examples of good solutions to the exercises available?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions