Skip to content

Commit

Permalink
Clippy updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ambiguousname committed Jul 29, 2024
1 parent 98cade6 commit 7500ccb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
4 changes: 2 additions & 2 deletions tool/src/demo_gen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub(crate) fn attr_support() -> BackendAttrSupport {
a.constructors = true;
a.fallible_constructors = true;

return a;
a
}

/// Per https://docs.google.com/document/d/1xRTmK0YtOfuAe7ClN6kqDaHyv5HpdIRIYQW6Zc_KKFU/edit?usp=sharing
Expand Down Expand Up @@ -78,7 +78,7 @@ pub(crate) fn run<'tcx>(
.set_context_method(ty.name().as_str().into(), method.name.as_str().into());

let mut ctx = RenderTerminusContext {
tcx: &tcx,
tcx,
formatter: &formatter,
errors: &errors,
terminus_info: TerminusInfo {
Expand Down
12 changes: 4 additions & 8 deletions tool/src/demo_gen/terminus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl<'ctx, 'tcx> RenderTerminusContext<'ctx, 'tcx> {
Type::Enum(e) => {
let type_name = self.formatter.fmt_type_name(e.tcx_id.into()).to_string();

if e.resolve(&self.tcx).attrs.disable {
if e.resolve(self.tcx).attrs.disable {
self.errors
.push_error(format!("Found usage of disabled type {type_name}"))
}
Expand Down Expand Up @@ -342,13 +342,9 @@ impl<'ctx, 'tcx> RenderTerminusContext<'ctx, 'tcx> {
// We represent as function () instead of () => since closures ignore the `this` args applied to them for whatever reason.

// TODO: Currently haven't run into other methods that require special syntax to be called in this way, but this might change.
let is_getter = if let Some(s) = &method.attrs.special_method {
match s {
hir::SpecialMethod::Getter(_) => true,
_ => false,
}
} else {
false
let is_getter = match method.attrs.special_method {
Some(hir::SpecialMethod::Getter(_)) => true,
_ => false
};

format!(
Expand Down
4 changes: 0 additions & 4 deletions tool/src/js/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ impl<'tcx> JSFormatter<'tcx> {
format!("{ident} | null")
}

pub fn fmt_null(&self) -> &'static str {
"null"
}

pub fn fmt_string(&self) -> &'static str {
"string"
}
Expand Down
2 changes: 1 addition & 1 deletion tool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn gen(
// TODO: Command Line Options.
// I.e., being able to replace this with just updating the imports:
gen(
&entry,
entry,
"js",
&out_folder.join("js"),
docs_url_gen,
Expand Down

0 comments on commit 7500ccb

Please sign in to comment.