summaryrefslogtreecommitdiff
path: root/rustlings-macros
diff options
context:
space:
mode:
authorMo <76752051+mo8it@users.noreply.github.com>2024-04-18 13:02:35 +0200
committerGitHub <noreply@github.com>2024-04-18 13:02:35 +0200
commit819dea250034a5658d0fe3306f6c35fc49961e17 (patch)
tree122060cdc0ef3f81d367e0afc7b0e3e9d29d33ee /rustlings-macros
parentc613b70363c60c6f4305d09c7394c96cdc6b69e4 (diff)
parent01e6732e4d920d9a1859e05fa28382e4307571af (diff)
Merge pull request #1949 from rust-lang/third-party-exercises
Support for third-party exercises
Diffstat (limited to 'rustlings-macros')
-rw-r--r--rustlings-macros/Cargo.toml1
-rw-r--r--rustlings-macros/src/lib.rs11
2 files changed, 3 insertions, 9 deletions
diff --git a/rustlings-macros/Cargo.toml b/rustlings-macros/Cargo.toml
index 79279f5..095deaa 100644
--- a/rustlings-macros/Cargo.toml
+++ b/rustlings-macros/Cargo.toml
@@ -1,5 +1,6 @@
[package]
name = "rustlings-macros"
+description = "A macros crate intended to be only used by rustlings"
version.workspace = true
authors.workspace = true
license.workspace = true
diff --git a/rustlings-macros/src/lib.rs b/rustlings-macros/src/lib.rs
index d8da666..d95a93a 100644
--- a/rustlings-macros/src/lib.rs
+++ b/rustlings-macros/src/lib.rs
@@ -15,8 +15,8 @@ pub fn include_files(_: TokenStream) -> TokenStream {
let mut files = Vec::with_capacity(8);
let mut dirs = Vec::with_capacity(128);
- for entry in read_dir("exercises").expect("Failed to open the exercises directory") {
- let entry = entry.expect("Failed to read the exercises directory");
+ for entry in read_dir("exercises").expect("Failed to open the `exercises` directory") {
+ let entry = entry.expect("Failed to read the `exercises` directory");
if entry.file_type().unwrap().is_file() {
let path = entry.path();
@@ -46,13 +46,6 @@ pub fn include_files(_: TokenStream) -> TokenStream {
return None;
}
- if path.extension() != Some("rs".as_ref()) {
- panic!(
- "Found {} but expected only README.md and .rs files",
- path.display(),
- );
- }
-
Some(path_to_string(path))
});