Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions po/da.po
Original file line number Diff line number Diff line change
Expand Up @@ -2659,8 +2659,6 @@ msgstr ""
#: src/exercises/day-2/health-statistics.md:13
msgid ""
"```rust,should_panic\n"
"// TODO: remove this when you're done with your implementation.\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't modify the .po files — only the translators can update those.

"#![allow(unused_variables, dead_code)]"
msgstr ""

#: src/exercises/day-1/for-loops.md:56
Expand Down Expand Up @@ -5125,8 +5123,6 @@ msgstr ""
#: src/exercises/day-2/strings-iterators.md:12
msgid ""
"```rust\n"
"// TODO: remove this when you're done with your implementation.\n"
"#![allow(unused_variables, dead_code)]"
msgstr ""

#: src/exercises/day-2/points-polygons.md:11
Expand Down Expand Up @@ -7343,9 +7339,7 @@ msgstr ""
#: src/exercises/day-3/simple-gui.md:18
#: src/exercises/day-3/safe-ffi-wrapper.md:25
msgid ""
"```rust,should_panic\n"
"// TODO: remove this when you're done with your implementation.\n"
"#![allow(unused_imports, unused_variables, dead_code)]"
"```rust,should_panic"
msgstr ""

#: src/exercises/day-3/simple-gui.md:22
Expand Down
2 changes: 0 additions & 2 deletions src/exercises/day-1/book-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Use this to create a library application. Copy the code below to
<https://play.rust-lang.org/> and update the types to make it compile:

```rust,should_panic
// TODO: remove this when you're done with your implementation.
#![allow(unused_variables, dead_code)]

{{#include book-library.rs:setup}}

Expand Down
4 changes: 2 additions & 2 deletions src/exercises/day-1/for-loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ Copy the code below to <https://play.rust-lang.org/> and implement the
functions:

```rust,should_panic
// TODO: remove this when you're done with your implementation.
#![allow(unused_variables, dead_code)]

{{#include for-loops.rs:transpose}}
println!("Use matrix {:?}", matrix);
unimplemented!()
}

{{#include for-loops.rs:pretty_print}}
println!("Use matrix {:?}", matrix);
unimplemented!()
}

Expand Down
2 changes: 0 additions & 2 deletions src/exercises/day-2/health-statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Copy the code below to <https://play.rust-lang.org/> and fill in the missing
methods:

```rust,should_panic
// TODO: remove this when you're done with your implementation.
#![allow(unused_variables, dead_code)]

{{#include ../../../third_party/rust-on-exercism/health-statistics.rs}}

Expand Down
4 changes: 1 addition & 3 deletions src/exercises/day-2/luhn.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ function:


```rust
// TODO: remove this when you're done with your implementation.
#![allow(unused_variables, dead_code)]

{{#include luhn.rs:luhn}}
println!("{cc_number}");
unimplemented!()
}

Expand Down
2 changes: 0 additions & 2 deletions src/exercises/day-2/points-polygons.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ to <https://play.rust-lang.org/> and fill in the missing methods to make the
tests pass:

```rust
// TODO: remove this when you're done with your implementation.
#![allow(unused_variables, dead_code)]

{{#include points-polygons.rs:Point}}
// add fields
Expand Down
3 changes: 1 addition & 2 deletions src/exercises/day-2/strings-iterators.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ pass. Try avoiding allocating a `Vec` for your intermediate results:


```rust
// TODO: remove this when you're done with your implementation.
#![allow(unused_variables, dead_code)]

{{#include strings-iterators.rs:prefix_matches}}
println!("Use parameters {prefix} and {request_path}");
unimplemented!()
}

Expand Down
5 changes: 3 additions & 2 deletions src/exercises/day-3/safe-ffi-wrapper.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@ Copy the code below to <https://play.rust-lang.org/> and fill in the missing
functions and methods:

```rust,should_panic
// TODO: remove this when you're done with your implementation.
#![allow(unused_imports, unused_variables, dead_code)]

{{#include safe-ffi-wrapper.rs:ffi}}

{{#include safe-ffi-wrapper.rs:DirectoryIterator}}
print!("The path {:?}", path);
unimplemented!()
}
}

{{#include safe-ffi-wrapper.rs:Iterator}}
print!("The path {:?}", self.path);
unimplemented!()
}
}

{{#include safe-ffi-wrapper.rs:Drop}}
print!("The path {:?}", self.path);
unimplemented!()
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/exercises/day-3/simple-gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Copy the code below to <https://play.rust-lang.org/>, fill in the missing
`draw_into` methods so that you implement the `Widget` trait:

```rust,should_panic
// TODO: remove this when you're done with your implementation.
#![allow(unused_imports, unused_variables, dead_code)]

{{#include simple-gui.rs:setup}}

Expand Down
6 changes: 6 additions & 0 deletions third_party/rust-on-exercism/health-statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,32 @@ struct User {

impl User {
pub fn new(name: String, age: u32, weight: f32) -> Self {
println!("Use name {:?} age {:?} and weight{:?}", name, age, weight);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to inline the format strings everywhere else in the course:

Suggested change
println!("Use name {:?} age {:?} and weight{:?}", name, age, weight);
println!("Use name {name:?} age {age:?} and weight {weight:?}");

I also fixed a space, which makes me think that you've not looked at this in the browser after making the change?

unimplemented!()
}

pub fn name(&self) -> &str {
println!("Use name {:?}", self.name);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we've agreed that this is a good way to "fix" the warnings? I would have added such print statements already if this is a nice way to solve it 🙂

unimplemented!()
}

pub fn age(&self) -> u32 {
println!("Use name {:?}", self.name);
unimplemented!()
}

pub fn weight(&self) -> f32 {
println!("Use name {:?}", self.name);
unimplemented!()
}

pub fn set_age(&mut self, new_age: u32) {
println!("Use name {:?} and new age {:?}", self.name, new_age);
unimplemented!()
}

pub fn set_weight(&mut self, new_weight: f32) {
println!("Use name {:?} and new age {:?}", self.name, new_weight);
unimplemented!()
}
}