mirror of
https://github.com/notohh/rustlings.git
synced 2024-12-17 22:58:08 -05:00
Allow dead code for all exercises and solutions
This commit is contained in:
parent
3947c4de28
commit
0513660b05
9 changed files with 8 additions and 18 deletions
|
@ -203,19 +203,21 @@ panic = "abort"
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
||||||
[lints.rust]
|
[lints.rust]
|
||||||
# You shouldn't write unsafe code in Rustlings
|
# You shouldn't write unsafe code in Rustlings!
|
||||||
unsafe_code = "forbid"
|
unsafe_code = "forbid"
|
||||||
# You don't need unstable features in Rustlings and shouldn't rely on them while learning Rust
|
# You don't need unstable features in Rustlings and shouldn't rely on them while learning Rust.
|
||||||
unstable_features = "forbid"
|
unstable_features = "forbid"
|
||||||
|
|
||||||
[lints.clippy]
|
[lints.clippy]
|
||||||
# You forgot a `todo!()`
|
# You forgot a `todo!()`!
|
||||||
todo = "forbid"
|
todo = "forbid"
|
||||||
# This can only happen by mistake in Rustlings
|
# This can only happen by mistake in Rustlings.
|
||||||
empty_loop = "forbid"
|
empty_loop = "forbid"
|
||||||
# No infinite loops are needed in Rustlings
|
# No infinite loops are needed in Rustlings.
|
||||||
infinite_loop = "deny"
|
infinite_loop = "deny"
|
||||||
# You shouldn't leak memory while still learning Rust
|
# You shouldn't leak memory while still learning Rust!
|
||||||
mem_forget = "deny"
|
mem_forget = "deny"
|
||||||
|
# Dead code warnings can't be avoided in some exercises and might distract while learning.
|
||||||
|
dead_code = "allow"
|
||||||
# Currently, there are no disallowed methods. This line avoids problems when developing Rustlings.
|
# Currently, there are no disallowed methods. This line avoids problems when developing Rustlings.
|
||||||
disallowed_methods = "allow"
|
disallowed_methods = "allow"
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Point {
|
struct Point {
|
||||||
x: u64,
|
x: u64,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// You can bring module paths into scopes and provide new names for them with
|
// You can bring module paths into scopes and provide new names for them with
|
||||||
// the `use` and `as` keywords.
|
// the `use` and `as` keywords.
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
mod delicious_snacks {
|
mod delicious_snacks {
|
||||||
// TODO: Add the following two `use` statements after fixing them.
|
// TODO: Add the following two `use` statements after fixing them.
|
||||||
// use self::fruits::PEAR as ???;
|
// use self::fruits::PEAR as ???;
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
trait Licensed {
|
trait Licensed {
|
||||||
// TODO: Add a default implementation for `licensing_info` so that
|
// TODO: Add a default implementation for `licensing_info` so that
|
||||||
// implementors like the two structs below can share that default behavior
|
// implementors like the two structs below can share that default behavior
|
||||||
|
|
|
@ -8,7 +8,6 @@ use std::rc::Rc;
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Sun;
|
struct Sun;
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum Planet {
|
enum Planet {
|
||||||
Mercury(Rc<Sun>),
|
Mercury(Rc<Sun>),
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Point {
|
struct Point {
|
||||||
x: u64,
|
x: u64,
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#[allow(dead_code)]
|
|
||||||
mod delicious_snacks {
|
mod delicious_snacks {
|
||||||
// Added `pub` and used the expected alias after `as`.
|
// Added `pub` and used the expected alias after `as`.
|
||||||
pub use self::fruits::PEAR as fruit;
|
pub use self::fruits::PEAR as fruit;
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
trait Licensed {
|
trait Licensed {
|
||||||
fn licensing_info(&self) -> String {
|
fn licensing_info(&self) -> String {
|
||||||
"Default license".to_string()
|
"Default license".to_string()
|
||||||
|
|
|
@ -8,7 +8,6 @@ use std::rc::Rc;
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Sun;
|
struct Sun;
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum Planet {
|
enum Planet {
|
||||||
Mercury(Rc<Sun>),
|
Mercury(Rc<Sun>),
|
||||||
|
|
Loading…
Reference in a new issue