Skip to content

Commit

Permalink
Replace inline(always) with inline (#6590)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored Aug 15, 2023
1 parent 232b44a commit 455db84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
12 changes: 4 additions & 8 deletions crates/ruff_formatter/src/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ impl<'fmt, Context> Argument<'fmt, Context> {
#[doc(hidden)]
#[inline]
pub fn new<F: Format<Context>>(value: &'fmt F) -> Self {
#[allow(clippy::inline_always)]
#[inline(always)]
#[inline]
fn formatter<F: Format<Context>, Context>(
ptr: *const c_void,
fmt: &mut Formatter<Context>,
Expand All @@ -52,8 +51,7 @@ impl<'fmt, Context> Argument<'fmt, Context> {
}

/// Formats the value stored by this argument using the given formatter.
#[allow(clippy::inline_always)]
#[inline(always)]
#[inline]
pub(super) fn format(&self, f: &mut Formatter<Context>) -> FormatResult<()> {
(self.formatter)(self.value, f)
}
Expand Down Expand Up @@ -82,9 +80,8 @@ impl<'fmt, Context> Argument<'fmt, Context> {
pub struct Arguments<'fmt, Context>(pub &'fmt [Argument<'fmt, Context>]);

impl<'fmt, Context> Arguments<'fmt, Context> {
#[allow(clippy::inline_always)]
#[doc(hidden)]
#[inline(always)]
#[inline]
pub fn new(arguments: &'fmt [Argument<'fmt, Context>]) -> Self {
Self(arguments)
}
Expand All @@ -106,8 +103,7 @@ impl<Context> Clone for Arguments<'_, Context> {
}

impl<Context> Format<Context> for Arguments<'_, Context> {
#[allow(clippy::inline_always)]
#[inline(always)]
#[inline]
fn fmt(&self, formatter: &mut Formatter<Context>) -> FormatResult<()> {
formatter.write_fmt(*self)
}
Expand Down
3 changes: 1 addition & 2 deletions crates/ruff_python_ast/src/visitor/preorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use crate::{

/// Visitor that traverses all nodes recursively in pre-order.
pub trait PreorderVisitor<'a> {
#[allow(clippy::inline_always)]
#[inline(always)]
#[inline]
fn enter_node(&mut self, _node: AnyNodeRef<'a>) -> TraversalSignal {
TraversalSignal::Traverse
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_python_formatter/src/comments/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ impl<'a> Comments<'a> {

#[inline(always)]
#[cfg(not(debug_assertions))]
pub(crate) fn mark_verbatim_node_comments_formatted(&self, node: AnyNodeRef) {}
pub(crate) fn mark_verbatim_node_comments_formatted(&self, _node: AnyNodeRef) {}

/// Marks the comments of a node printed in verbatim (suppressed) as formatted.
///
Expand Down

0 comments on commit 455db84

Please sign in to comment.