Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ambiguousname committed Dec 12, 2024
1 parent f3a1ec8 commit 9a3bb20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions tool/src/js/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use super::converter::{ForcePaddingStatus, JsToCConversionContext, StructBorrowC
/// Represents list of imports that our Type is going to use.
/// Resolved in [`TyGenContext::generate_base`]
pub(super) struct Imports<'tcx> {
pub js : BTreeSet<ImportInfo<'tcx>>,
pub ts : BTreeSet<ImportInfo<'tcx>>
pub js: BTreeSet<ImportInfo<'tcx>>,
pub ts: BTreeSet<ImportInfo<'tcx>>,
}

/// Represents context for generating a Javascript class.
Expand Down Expand Up @@ -56,11 +56,7 @@ impl<'tcx> TyGenContext<'_, 'tcx> {
let i = self.imports.borrow();

let mut new_imports = Vec::new();
let imports = if typescript {
i.ts.iter()
} else {
i.js.iter()
};
let imports = if typescript { i.ts.iter() } else { i.js.iter() };

for import in imports {
new_imports.push(self.formatter.fmt_import_statement(
Expand Down
2 changes: 1 addition & 1 deletion tool/src/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub(crate) fn run<'tcx>(
errors: &errors,
imports: RefCell::new(gen::Imports {
js: BTreeSet::new(),
ts: BTreeSet::new()
ts: BTreeSet::new(),
}),
};

Expand Down

0 comments on commit 9a3bb20

Please sign in to comment.