From 179a75a68d03ac9518dec2297fb17f91a4fc506b Mon Sep 17 00:00:00 2001 From: x-hgg-x <39058530+x-hgg-x@users.noreply.github.com> Date: Tue, 29 Mar 2022 11:44:06 +0200 Subject: [PATCH] fix: Include exercises folder in the project structure behind a feature (#917) closes #859 closes #913 closes #942 --- Cargo.toml | 5 ++++- exercises/advanced_errors/mod.rs | 2 ++ exercises/clippy/mod.rs | 2 ++ exercises/collections/mod.rs | 4 ++++ exercises/conversions/mod.rs | 5 +++++ exercises/enums/mod.rs | 3 +++ exercises/error_handling/mod.rs | 6 ++++++ exercises/functions/mod.rs | 5 +++++ exercises/generics/mod.rs | 3 +++ exercises/if/mod.rs | 2 ++ exercises/intro/mod.rs | 2 ++ exercises/macros/mod.rs | 4 ++++ exercises/mod.rs | 26 +++++++++++++++++++++++++ exercises/modules/mod.rs | 3 +++ exercises/move_semantics/mod.rs | 5 +++++ exercises/option/mod.rs | 3 +++ exercises/primitive_types/mod.rs | 6 ++++++ exercises/standard_library_types/mod.rs | 7 +++++++ exercises/strings/mod.rs | 2 ++ exercises/structs/mod.rs | 3 +++ exercises/tests/mod.rs | 3 +++ exercises/threads/mod.rs | 1 + exercises/traits/mod.rs | 2 ++ exercises/variables/mod.rs | 6 ++++++ src/lib.rs | 3 +++ 25 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 exercises/advanced_errors/mod.rs create mode 100644 exercises/clippy/mod.rs create mode 100644 exercises/collections/mod.rs create mode 100644 exercises/conversions/mod.rs create mode 100644 exercises/enums/mod.rs create mode 100644 exercises/error_handling/mod.rs create mode 100644 exercises/functions/mod.rs create mode 100644 exercises/generics/mod.rs create mode 100644 exercises/if/mod.rs create mode 100644 exercises/intro/mod.rs create mode 100644 exercises/macros/mod.rs create mode 100644 exercises/mod.rs create mode 100644 exercises/modules/mod.rs create mode 100644 exercises/move_semantics/mod.rs create mode 100644 exercises/option/mod.rs create mode 100644 exercises/primitive_types/mod.rs create mode 100644 exercises/standard_library_types/mod.rs create mode 100644 exercises/strings/mod.rs create mode 100644 exercises/structs/mod.rs create mode 100644 exercises/tests/mod.rs create mode 100644 exercises/threads/mod.rs create mode 100644 exercises/traits/mod.rs create mode 100644 exercises/variables/mod.rs create mode 100644 src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 30032695..4761c9a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ console = "0.7.7" notify = "4.0.15" toml = "0.4.10" regex = "1.1.6" -serde = {version = "1.0.10", features = ["derive"]} +serde = { version = "1.0.10", features = ["derive"] } [[bin]] name = "rustlings" @@ -21,3 +21,6 @@ path = "src/main.rs" assert_cmd = "0.11.0" predicates = "1.0.1" glob = "0.3.0" + +[features] +exercises = [] diff --git a/exercises/advanced_errors/mod.rs b/exercises/advanced_errors/mod.rs new file mode 100644 index 00000000..e33fb80d --- /dev/null +++ b/exercises/advanced_errors/mod.rs @@ -0,0 +1,2 @@ +mod advanced_errs1; +mod advanced_errs2; diff --git a/exercises/clippy/mod.rs b/exercises/clippy/mod.rs new file mode 100644 index 00000000..689dc95f --- /dev/null +++ b/exercises/clippy/mod.rs @@ -0,0 +1,2 @@ +mod clippy1; +mod clippy2; diff --git a/exercises/collections/mod.rs b/exercises/collections/mod.rs new file mode 100644 index 00000000..f46c1424 --- /dev/null +++ b/exercises/collections/mod.rs @@ -0,0 +1,4 @@ +mod hashmap1; +mod hashmap2; +mod vec1; +mod vec2; diff --git a/exercises/conversions/mod.rs b/exercises/conversions/mod.rs new file mode 100644 index 00000000..69f66ae4 --- /dev/null +++ b/exercises/conversions/mod.rs @@ -0,0 +1,5 @@ +mod as_ref_mut; +mod from_into; +mod from_str; +mod try_from_into; +mod using_as; diff --git a/exercises/enums/mod.rs b/exercises/enums/mod.rs new file mode 100644 index 00000000..a23fd6e5 --- /dev/null +++ b/exercises/enums/mod.rs @@ -0,0 +1,3 @@ +mod enums1; +mod enums2; +mod enums3; diff --git a/exercises/error_handling/mod.rs b/exercises/error_handling/mod.rs new file mode 100644 index 00000000..539fa23d --- /dev/null +++ b/exercises/error_handling/mod.rs @@ -0,0 +1,6 @@ +mod errors1; +mod errors2; +mod errors3; +mod errors4; +mod errors5; +mod errors6; diff --git a/exercises/functions/mod.rs b/exercises/functions/mod.rs new file mode 100644 index 00000000..445b6f58 --- /dev/null +++ b/exercises/functions/mod.rs @@ -0,0 +1,5 @@ +mod functions1; +mod functions2; +mod functions3; +mod functions4; +mod functions5; diff --git a/exercises/generics/mod.rs b/exercises/generics/mod.rs new file mode 100644 index 00000000..5b93555c --- /dev/null +++ b/exercises/generics/mod.rs @@ -0,0 +1,3 @@ +mod generics1; +mod generics2; +mod generics3; diff --git a/exercises/if/mod.rs b/exercises/if/mod.rs new file mode 100644 index 00000000..c5d02445 --- /dev/null +++ b/exercises/if/mod.rs @@ -0,0 +1,2 @@ +mod if1; +mod if2; diff --git a/exercises/intro/mod.rs b/exercises/intro/mod.rs new file mode 100644 index 00000000..445c47ab --- /dev/null +++ b/exercises/intro/mod.rs @@ -0,0 +1,2 @@ +mod intro1; +mod intro2; diff --git a/exercises/macros/mod.rs b/exercises/macros/mod.rs new file mode 100644 index 00000000..9f65acf5 --- /dev/null +++ b/exercises/macros/mod.rs @@ -0,0 +1,4 @@ +mod macros1; +mod macros2; +mod macros3; +mod macros4; diff --git a/exercises/mod.rs b/exercises/mod.rs new file mode 100644 index 00000000..6a143b56 --- /dev/null +++ b/exercises/mod.rs @@ -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; diff --git a/exercises/modules/mod.rs b/exercises/modules/mod.rs new file mode 100644 index 00000000..35f96af5 --- /dev/null +++ b/exercises/modules/mod.rs @@ -0,0 +1,3 @@ +mod modules1; +mod modules2; +mod modules3; diff --git a/exercises/move_semantics/mod.rs b/exercises/move_semantics/mod.rs new file mode 100644 index 00000000..c9e61b36 --- /dev/null +++ b/exercises/move_semantics/mod.rs @@ -0,0 +1,5 @@ +mod move_semantics1; +mod move_semantics2; +mod move_semantics3; +mod move_semantics4; +mod move_semantics5; diff --git a/exercises/option/mod.rs b/exercises/option/mod.rs new file mode 100644 index 00000000..b3cdb13d --- /dev/null +++ b/exercises/option/mod.rs @@ -0,0 +1,3 @@ +mod option1; +mod option2; +mod option3; diff --git a/exercises/primitive_types/mod.rs b/exercises/primitive_types/mod.rs new file mode 100644 index 00000000..23355239 --- /dev/null +++ b/exercises/primitive_types/mod.rs @@ -0,0 +1,6 @@ +mod primitive_types1; +mod primitive_types2; +mod primitive_types3; +mod primitive_types4; +mod primitive_types5; +mod primitive_types6; diff --git a/exercises/standard_library_types/mod.rs b/exercises/standard_library_types/mod.rs new file mode 100644 index 00000000..b03acb92 --- /dev/null +++ b/exercises/standard_library_types/mod.rs @@ -0,0 +1,7 @@ +mod arc1; +mod box1; +mod iterators1; +mod iterators2; +mod iterators3; +mod iterators4; +mod iterators5; diff --git a/exercises/strings/mod.rs b/exercises/strings/mod.rs new file mode 100644 index 00000000..b1b460bc --- /dev/null +++ b/exercises/strings/mod.rs @@ -0,0 +1,2 @@ +mod strings1; +mod strings2; diff --git a/exercises/structs/mod.rs b/exercises/structs/mod.rs new file mode 100644 index 00000000..214fed16 --- /dev/null +++ b/exercises/structs/mod.rs @@ -0,0 +1,3 @@ +mod structs1; +mod structs2; +mod structs3; diff --git a/exercises/tests/mod.rs b/exercises/tests/mod.rs new file mode 100644 index 00000000..489541be --- /dev/null +++ b/exercises/tests/mod.rs @@ -0,0 +1,3 @@ +mod tests1; +mod tests2; +mod tests3; diff --git a/exercises/threads/mod.rs b/exercises/threads/mod.rs new file mode 100644 index 00000000..24d54007 --- /dev/null +++ b/exercises/threads/mod.rs @@ -0,0 +1 @@ +mod threads1; diff --git a/exercises/traits/mod.rs b/exercises/traits/mod.rs new file mode 100644 index 00000000..6f0a9c3f --- /dev/null +++ b/exercises/traits/mod.rs @@ -0,0 +1,2 @@ +mod traits1; +mod traits2; diff --git a/exercises/variables/mod.rs b/exercises/variables/mod.rs new file mode 100644 index 00000000..a25f477e --- /dev/null +++ b/exercises/variables/mod.rs @@ -0,0 +1,6 @@ +mod variables1; +mod variables2; +mod variables3; +mod variables4; +mod variables5; +mod variables6; diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 00000000..82c1e7e4 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,3 @@ +#[cfg(feature = "exercises")] +#[path = "../exercises/mod.rs"] +mod exercises;