Skip to content

Debug constraint required in print functions#26

Merged
tfpk merged 1 commit intotfpk:mainfrom
sohang3112:patch-1
Oct 29, 2022
Merged

Debug constraint required in print functions#26
tfpk merged 1 commit intotfpk:mainfrom
sohang3112:patch-1

Conversation

@sohang3112
Copy link
Copy Markdown
Contributor

Debug constraint is required for K, V in functions print_pair, print_hashmap because code like:

println!("{some_variable:#?}");

requires some_variable to implement Debug trait.

Without this change, there is Compile Error.

`Debug` constraint is required for `K`, `V` in functions `print_pair`, `print_hashmap`  because code like:
```rust
println!("{some_variable:#?}");
```
requires `some_variable` to implement `Debug` trait.
@tfpk
Copy link
Copy Markdown
Owner

tfpk commented Oct 29, 2022

Thanks :)

@tfpk tfpk merged commit 7a0eb79 into tfpk:main Oct 29, 2022
@sohang3112 sohang3112 deleted the patch-1 branch October 29, 2022 08:05
@sohang3112
Copy link
Copy Markdown
Contributor Author

Actually I couldn't solve this one (10th exercise). My code is this. Can you tell me what I'm doing wrong here?

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.

2 participants