Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
chore: Upgrade to Rust 1.65.0 (#3557)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored Nov 4, 2022
1 parent 175662b commit 20c46ac
Show file tree
Hide file tree
Showing 35 changed files with 1,254 additions and 1,297 deletions.
1 change: 1 addition & 0 deletions crates/rome_analyze/src/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ impl MissingServicesDiagnostic {
}

pub trait FromServices: Sized {
#[allow(clippy::result_large_err)]
fn from_services(
rule_key: &RuleKey,
services: &ServiceBag,
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_cli/tests/snap_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl CliSnapshot {
let _ = write!(content, "## `{name}`\n\n");
let _ = write!(content, "```{extension}");
content.push('\n');
content.push_str(&**file_content);
content.push_str(file_content);
content.push('\n');
content.push_str("```");
content.push_str("\n\n")
Expand Down
4 changes: 2 additions & 2 deletions crates/rome_fs/src/fs/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ impl<'scope> TraversalScope<'scope> for MemoryTraversalScope<'scope> {
let should_process_file = if base.starts_with(".") || base.starts_with("./") {
// we simulate absolute paths, so we can correctly strips out the base path from the path
let absolute_base = PathBuf::from("/").join(&base);
let absolute_path = Path::new("/").join(&path);
let absolute_path = Path::new("/").join(path);
absolute_path.strip_prefix(&absolute_base).is_ok()
} else {
path.strip_prefix(&base).is_ok()
};

if should_process_file {
let file_id = ctx.interner().intern_path(path.into());
let rome_path = RomePath::new(&path, file_id);
let rome_path = RomePath::new(path, file_id);
if !ctx.can_handle(&rome_path) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_js_analyze/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn metadata() -> &'static MetadataRegistry {
};
}

&*METADATA
&METADATA
}

/// Run the analyzer on the provided `root`: this process will use the given `filter`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ impl Rule for NoFunctionAssign {
let node = reference.node();
diag = diag.detail(node.text_trimmed_range(), "Reassigned here.");

hoisted_quantity += if reference.is_using_hoisted_declaration() {
1
} else {
0
};
hoisted_quantity += i32::from(reference.is_using_hoisted_declaration());
}

let diag = if hoisted_quantity > 0 {
Expand Down
6 changes: 3 additions & 3 deletions crates/rome_js_formatter/src/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use rome_rowan::AstNode;

/// Formats a node using its [`AsFormat`] implementation but falls back to printing the node as
/// it is in the source document if the formatting returns an [`FormatError`].
pub const fn format_or_verbatim<'a, Node>(node: &'a Node) -> FormatNodeOrVerbatim<'a, Node>
pub const fn format_or_verbatim<Node>(node: &Node) -> FormatNodeOrVerbatim<Node>
where
Node: AstNode<Language = JsLanguage> + AsFormat<'a>,
Node: AstNode<Language = JsLanguage> + AsFormat,
{
FormatNodeOrVerbatim { node }
}
Expand All @@ -20,7 +20,7 @@ pub struct FormatNodeOrVerbatim<'a, Node> {

impl<'a, Node> Format<JsFormatContext> for FormatNodeOrVerbatim<'a, Node>
where
Node: AstNode<Language = JsLanguage> + AsFormat<'a>,
Node: AstNode<Language = JsLanguage> + AsFormat,
{
fn fmt(&self, f: &mut JsFormatter) -> FormatResult<()> {
let snapshot = Formatter::state_snapshot(f);
Expand Down
6 changes: 3 additions & 3 deletions crates/rome_js_formatter/src/cst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ impl rome_formatter::FormatRule<JsSyntaxNode> for FormatJsSyntaxNode {
}
}

impl<'a> AsFormat<'a> for JsSyntaxNode {
type Format = FormatRefWithRule<'a, JsSyntaxNode, FormatJsSyntaxNode>;
impl AsFormat for JsSyntaxNode {
type Format<'a> = FormatRefWithRule<'a, JsSyntaxNode, FormatJsSyntaxNode>;

fn format(&'a self) -> Self::Format {
fn format(&self) -> Self::Format<'_> {
FormatRefWithRule::new(self, FormatJsSyntaxNode)
}
}
Expand Down
Loading

0 comments on commit 20c46ac

Please sign in to comment.