Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
clippy
  • Loading branch information
ematipico committed Jul 23, 2023
commit de0bcb4b3bf07d156616bbaa2b4c0777f2fa5162
2 changes: 1 addition & 1 deletion crates/rome_js_analyze/tests/spec_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fn check_code_action(

// Re-parse the modified code and panic if the resulting tree has syntax errors
let re_parse = parse(&output, source_type, options);
assert_errors_are_absent(&re_parse.tree().syntax(), re_parse.diagnostics(), path);
assert_errors_are_absent(re_parse.tree().syntax(), re_parse.diagnostics(), path);
}

pub(crate) fn run_suppression_test(input: &'static str, _: &str, _: &str, _: &str) {
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_js_syntax/src/file_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl JsFileSource {
self.module_kind.is_module()
}

pub fn as_extension_name(&self) -> &str {
pub fn file_extension(&self) -> &str {
match self.language {
Language::JavaScript => {
if matches!(self.variant, LanguageVariant::Jsx) {
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_js_transform/src/transformers/ts_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ fn make_members(ts_enum: &TsEnumMembers) -> JsStatementList {
for (index, (name, value)) in ts_enum.member_names.iter().enumerate() {
let value = value
.as_ref()
.and_then(|initializer| Some(initializer.expression().ok()?.clone()))
.and_then(|initializer| initializer.expression().ok())
.unwrap_or_else(|| {
AnyJsExpression::AnyJsLiteralExpression(
AnyJsLiteralExpression::JsNumberLiteralExpression(
Expand Down
4 changes: 2 additions & 2 deletions crates/rome_js_transform/tests/spec_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub(crate) fn analyze_and_snap(
snapshot,
input_code,
transformations.as_slice(),
source_type.as_extension_name(),
source_type.file_extension(),
);

diagnostics.len()
Expand Down Expand Up @@ -164,5 +164,5 @@ fn check_transformation(

// Re-parse the modified code and panic if the resulting tree has syntax errors
let re_parse = parse(&output, source_type, options);
assert_errors_are_absent(&re_parse.tree().syntax(), re_parse.diagnostics(), path);
assert_errors_are_absent(re_parse.tree().syntax(), re_parse.diagnostics(), path);
}
2 changes: 1 addition & 1 deletion crates/rome_json_analyze/tests/spec_tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rome_analyze::{AnalysisFilter, AnalyzerAction, ControlFlow, Never, RuleFilter};
use rome_diagnostics::advice::CodeSuggestionAdvice;
use rome_diagnostics::{DiagnosticExt, Severity};
use rome_json_parser::parse_json;
use rome_json_parser::{parse_json, JsonParserOptions};
use rome_json_syntax::JsonLanguage;
use rome_rowan::AstNode;
use rome_test_utils::{
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_rowan/src/ast/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ where

for change in &self.changes {
let parent = change.parent.as_ref().unwrap_or(&self.root);
let delete = match dbg!(parent.slots().nth(change.new_node_slot)) {
let delete = match parent.slots().nth(change.new_node_slot) {
Some(SyntaxSlot::Node(node)) => node.text_range(),
Some(SyntaxSlot::Token(token)) => token.text_range(),
_ => continue,
Expand Down
3 changes: 1 addition & 2 deletions crates/rome_test_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ pub fn assert_errors_are_absent<L: Language>(
let debug_tree = format!("{:?}", program);
let has_missing_children = debug_tree.contains("missing (required)");

if diagnostics.is_empty() && !has_bogus_nodes_or_empty_slots(&program) && !has_missing_children
{
if diagnostics.is_empty() && !has_bogus_nodes_or_empty_slots(program) && !has_missing_children {
return;
}

Expand Down