Skip to content

Commit 81440d6

Browse files
committed
Remove inject-libraries
1 parent fed176a commit 81440d6

File tree

4 files changed

+1
-397
lines changed

4 files changed

+1
-397
lines changed

src/rules/inject_libraries.rs

Lines changed: 0 additions & 269 deletions
This file was deleted.

src/rules/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ mod convert_require;
1010
mod empty_do;
1111
mod filter_early_return;
1212
mod group_local;
13-
mod inject_libraries;
1413
mod inject_value;
1514
mod method_def;
1615
mod no_local_function;
@@ -46,7 +45,6 @@ pub use convert_require::*;
4645
pub use empty_do::*;
4746
pub use filter_early_return::*;
4847
pub use group_local::*;
49-
pub use inject_libraries::*;
5048
pub use inject_value::*;
5149
pub use method_def::*;
5250
pub use no_local_function::*;
@@ -227,7 +225,6 @@ pub fn get_default_rules() -> Vec<Box<dyn Rule>> {
227225
Box::<RemoveFunctionCallParens>::default(),
228226
Box::<RemoveGeneralizedIteration>::default(),
229227
Box::<RemoveRedeclaredKeys>::default(),
230-
Box::<InjectLibraries>::default(),
231228
Box::<RemoveContinue>::default(),
232229
Box::<RemoveIfExpression>::default(),
233230
]
@@ -260,7 +257,6 @@ pub fn get_all_rule_names() -> Vec<&'static str> {
260257
RENAME_VARIABLES_RULE_NAME,
261258
REMOVE_GENERALIZED_ITERATION_RULE_NAME,
262259
REMOVE_REDECLARED_KEYS_RULE_NAME,
263-
INJECT_LIBRARIES_RULE_NAME,
264260
REMOVE_CONTINUE_RULE_NAME,
265261
REMOVE_IF_EXPRESSION_RULE_NAME,
266262
]
@@ -298,7 +294,6 @@ impl FromStr for Box<dyn Rule> {
298294
RENAME_VARIABLES_RULE_NAME => Box::<RenameVariables>::default(),
299295
REMOVE_GENERALIZED_ITERATION_RULE_NAME => Box::<RemoveGeneralizedIteration>::default(),
300296
REMOVE_REDECLARED_KEYS_RULE_NAME => Box::<RemoveRedeclaredKeys>::default(),
301-
INJECT_LIBRARIES_RULE_NAME => Box::<InjectLibraries>::default(),
302297
REMOVE_CONTINUE_RULE_NAME => Box::<RemoveContinue>::default(),
303298
REMOVE_IF_EXPRESSION_RULE_NAME => Box::<RemoveIfExpression>::default(),
304299
_ => return Err(format!("invalid rule name: {}", string)),

src/rules/rule_property.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use regex::Regex;
44
use serde::{Deserialize, Serialize};
55

66
use super::{
7-
require::PathRequireMode, Library, RequireMode, RobloxRequireMode, RuleConfigurationError,
7+
require::PathRequireMode, RequireMode, RobloxRequireMode, RuleConfigurationError,
88
};
99

1010
pub type RuleProperties = HashMap<String, RulePropertyValue>;
@@ -20,7 +20,6 @@ pub enum RulePropertyValue {
2020
Float(f64),
2121
StringList(Vec<String>),
2222
RequireMode(RequireMode),
23-
Libraries(Vec<Library>),
2423
None,
2524
}
2625

@@ -85,17 +84,6 @@ impl RulePropertyValue {
8584
_ => Err(RuleConfigurationError::RequireModeExpected(key.to_owned())),
8685
}
8786
}
88-
89-
pub(crate) fn expect_libraries(
90-
self,
91-
key: &str,
92-
) -> Result<Vec<Library>, RuleConfigurationError> {
93-
if let Self::Libraries(value) = self {
94-
Ok(value)
95-
} else {
96-
Err(RuleConfigurationError::LibrariesExpected(key.to_owned()))
97-
}
98-
}
9987
}
10088

10189
impl From<bool> for RulePropertyValue {
@@ -153,12 +141,6 @@ impl From<&RequireMode> for RulePropertyValue {
153141
}
154142
}
155143

156-
// impl From<&Library> for RulePropertyValue {
157-
// fn from(value: &Library) -> Self {
158-
// Self::Library(value.clone())
159-
// }
160-
// }
161-
162144
impl<T: Into<RulePropertyValue>> From<Option<T>> for RulePropertyValue {
163145
fn from(value: Option<T>) -> Self {
164146
match value {

0 commit comments

Comments
 (0)