Skip to content

Commit

Permalink
ran cargo fmt again
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefanuk12 committed Dec 20, 2024
1 parent 9acdb20 commit 39b2c0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
12 changes: 3 additions & 9 deletions src/rules/bundle/path_require_mode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,15 @@ impl<'a, 'b, 'code, 'resources, T: RequirePathLocatorMode>
}
}

impl<T: RequirePathLocatorMode> Deref
for RequirePathProcessor<'_, '_, '_, '_, T>
{
impl<T: RequirePathLocatorMode> Deref for RequirePathProcessor<'_, '_, '_, '_, T> {
type Target = IdentifierTracker;

fn deref(&self) -> &Self::Target {
&self.identifier_tracker
}
}

impl<T: RequirePathLocatorMode> DerefMut
for RequirePathProcessor<'_, '_, '_, '_, T>
{
impl<T: RequirePathLocatorMode> DerefMut for RequirePathProcessor<'_, '_, '_, '_, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.identifier_tracker
}
Expand Down Expand Up @@ -311,9 +307,7 @@ where
expression
}

impl<T: RequirePathLocatorMode> NodeProcessor
for RequirePathProcessor<'_, '_, '_, '_, T>
{
impl<T: RequirePathLocatorMode> NodeProcessor for RequirePathProcessor<'_, '_, '_, '_, T> {
fn process_expression(&mut self, expression: &mut Expression) {
if let Expression::Call(call) = expression {
if let Some(replace_with) = self.try_inline_call(call) {
Expand Down
14 changes: 9 additions & 5 deletions src/rules/require/hybrid_require_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,16 @@ fn parse_roblox_call(call: &FunctionCall, current_path: &mut PathBuf) -> Darklua

let mut temp_path = PathBuf::from("node_modules");
let Arguments::Tuple(args) = call.get_arguments() else {
return Err(
DarkluaError::custom("expected call arguments for TS.getModule to be a tuple")
.context("while parsing roblox-ts require"),
)?;
return Err(DarkluaError::custom(
"expected call arguments for TS.getModule to be a tuple",
)
.context("while parsing roblox-ts require"))?;
};
args.iter_values().for_each(|arg| if let Expression::String(x) = arg { temp_path.push(x.get_value()) });
args.iter_values().for_each(|arg| {
if let Expression::String(x) = arg {
temp_path.push(x.get_value())
}
});

let _ = temp_path.join(&current_path);
*current_path = temp_path;
Expand Down

0 comments on commit 39b2c0e

Please sign in to comment.