fix: Include exercises folder in the project structure behind a feature (#917)

closes #859
closes #913
closes #942
This commit is contained in:
x-hgg-x 2022-03-29 11:44:06 +02:00 committed by GitHub
parent cd2b5e8e3b
commit 179a75a68d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 112 additions and 1 deletions

View File

@ -11,7 +11,7 @@ console = "0.7.7"
notify = "4.0.15" notify = "4.0.15"
toml = "0.4.10" toml = "0.4.10"
regex = "1.1.6" regex = "1.1.6"
serde = {version = "1.0.10", features = ["derive"]} serde = { version = "1.0.10", features = ["derive"] }
[[bin]] [[bin]]
name = "rustlings" name = "rustlings"
@ -21,3 +21,6 @@ path = "src/main.rs"
assert_cmd = "0.11.0" assert_cmd = "0.11.0"
predicates = "1.0.1" predicates = "1.0.1"
glob = "0.3.0" glob = "0.3.0"
[features]
exercises = []

View File

@ -0,0 +1,2 @@
mod advanced_errs1;
mod advanced_errs2;

2
exercises/clippy/mod.rs Normal file
View File

@ -0,0 +1,2 @@
mod clippy1;
mod clippy2;

View File

@ -0,0 +1,4 @@
mod hashmap1;
mod hashmap2;
mod vec1;
mod vec2;

View File

@ -0,0 +1,5 @@
mod as_ref_mut;
mod from_into;
mod from_str;
mod try_from_into;
mod using_as;

3
exercises/enums/mod.rs Normal file
View File

@ -0,0 +1,3 @@
mod enums1;
mod enums2;
mod enums3;

View File

@ -0,0 +1,6 @@
mod errors1;
mod errors2;
mod errors3;
mod errors4;
mod errors5;
mod errors6;

View File

@ -0,0 +1,5 @@
mod functions1;
mod functions2;
mod functions3;
mod functions4;
mod functions5;

View File

@ -0,0 +1,3 @@
mod generics1;
mod generics2;
mod generics3;

2
exercises/if/mod.rs Normal file
View File

@ -0,0 +1,2 @@
mod if1;
mod if2;

2
exercises/intro/mod.rs Normal file
View File

@ -0,0 +1,2 @@
mod intro1;
mod intro2;

4
exercises/macros/mod.rs Normal file
View File

@ -0,0 +1,4 @@
mod macros1;
mod macros2;
mod macros3;
mod macros4;

26
exercises/mod.rs Normal file
View File

@ -0,0 +1,26 @@
mod advanced_errors;
mod clippy;
mod collections;
mod conversions;
mod enums;
mod error_handling;
mod functions;
mod generics;
mod r#if;
mod intro;
mod macros;
mod modules;
mod move_semantics;
mod option;
mod primitive_types;
mod quiz1;
mod quiz2;
mod quiz3;
mod quiz4;
mod standard_library_types;
mod strings;
mod structs;
mod tests;
mod threads;
mod traits;
mod variables;

3
exercises/modules/mod.rs Normal file
View File

@ -0,0 +1,3 @@
mod modules1;
mod modules2;
mod modules3;

View File

@ -0,0 +1,5 @@
mod move_semantics1;
mod move_semantics2;
mod move_semantics3;
mod move_semantics4;
mod move_semantics5;

3
exercises/option/mod.rs Normal file
View File

@ -0,0 +1,3 @@
mod option1;
mod option2;
mod option3;

View File

@ -0,0 +1,6 @@
mod primitive_types1;
mod primitive_types2;
mod primitive_types3;
mod primitive_types4;
mod primitive_types5;
mod primitive_types6;

View File

@ -0,0 +1,7 @@
mod arc1;
mod box1;
mod iterators1;
mod iterators2;
mod iterators3;
mod iterators4;
mod iterators5;

2
exercises/strings/mod.rs Normal file
View File

@ -0,0 +1,2 @@
mod strings1;
mod strings2;

3
exercises/structs/mod.rs Normal file
View File

@ -0,0 +1,3 @@
mod structs1;
mod structs2;
mod structs3;

3
exercises/tests/mod.rs Normal file
View File

@ -0,0 +1,3 @@
mod tests1;
mod tests2;
mod tests3;

1
exercises/threads/mod.rs Normal file
View File

@ -0,0 +1 @@
mod threads1;

2
exercises/traits/mod.rs Normal file
View File

@ -0,0 +1,2 @@
mod traits1;
mod traits2;

View File

@ -0,0 +1,6 @@
mod variables1;
mod variables2;
mod variables3;
mod variables4;
mod variables5;
mod variables6;

3
src/lib.rs Normal file
View File

@ -0,0 +1,3 @@
#[cfg(feature = "exercises")]
#[path = "../exercises/mod.rs"]
mod exercises;