Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove enum_iterator #710

Merged
merged 1 commit into from
Nov 26, 2021
Merged
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
21 changes: 0 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ license = "MPL-2.0"

[dependencies]
aho-corasick = "^0.7"
enum-iterator = "^0.7"
fxhash = "0.2"
lazy_static = "^1.3"
num-format = "^0.4"
Expand Down
1 change: 0 additions & 1 deletion enums/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ authors = ["Calixte Denizet <cdenizet@mozilla.com>"]
edition = "2021"

[dependencies]
enum-iterator = "^0.7"
clap = "^2.33"
askama = "^0.10"

Expand Down
1 change: 0 additions & 1 deletion enums/src/go.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use askama::Template;
use enum_iterator::IntoEnumIterator;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;
Expand Down
1 change: 0 additions & 1 deletion enums/src/json.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use askama::Template;
use enum_iterator::IntoEnumIterator;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;
Expand Down
1 change: 0 additions & 1 deletion enums/src/languages.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use enum_iterator::IntoEnumIterator;
use tree_sitter::Language;

use crate::*;
Expand Down
1 change: 0 additions & 1 deletion enums/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
extern crate askama;
extern crate enum_iterator;
extern crate tree_sitter;

#[macro_use]
Expand Down
8 changes: 7 additions & 1 deletion enums/src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
macro_rules! mk_enum {
( $( $camel:ident ),* ) => {
#[derive(Clone, Debug, IntoEnumIterator, PartialEq)]
#[derive(Clone, Debug, PartialEq)]
pub enum Lang {
$(
$camel,
)*
}
impl Lang {
pub fn into_enum_iter() -> impl Iterator<Item=Lang> {
use Lang::*;
[$( $camel, )*].into_iter()
}
}
};
}

Expand Down
1 change: 0 additions & 1 deletion enums/src/rust.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use askama::Template;
use enum_iterator::IntoEnumIterator;
use std::env;
use std::fs::File;
use std::io::{Read, Write};
Expand Down
1 change: 0 additions & 1 deletion src/langs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use enum_iterator::IntoEnumIterator;
use std::path::Path;
use std::sync::Arc;
use tree_sitter::Language;
Expand Down
8 changes: 7 additions & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,19 @@ macro_rules! get_language {
macro_rules! mk_enum {
( $( $camel:ident, $description:expr ),* ) => {
/// The list of supported languages.
#[derive(Clone, Copy, Debug, IntoEnumIterator, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum LANG {
$(
#[doc = $description]
$camel,
)*
}
impl LANG {
pub fn into_enum_iter() -> impl Iterator<Item=LANG> {
use LANG::*;
[$( $camel, )*].into_iter()
}
}
};
}

Expand Down