From c4fdbf89031d3e5fa42b8994eb54525a7ecb808a Mon Sep 17 00:00:00 2001 From: konstin Date: Fri, 2 Jun 2023 12:26:39 +0200 Subject: [PATCH] Switch PyFormatter lifetimes (#4804) Stylistic change to have the input lifetime first and the output lifetime second. I'll rebase my other PR on top of this. Test plan: `cargo clippy` --- crates/ruff_python_formatter/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ruff_python_formatter/src/lib.rs b/crates/ruff_python_formatter/src/lib.rs index 7a570a173f..20edde3d99 100644 --- a/crates/ruff_python_formatter/src/lib.rs +++ b/crates/ruff_python_formatter/src/lib.rs @@ -31,7 +31,8 @@ mod trivia; include!("../../ruff_formatter/shared_traits.rs"); -pub(crate) type PyFormatter<'buf, 'ast> = Formatter<'buf, PyFormatContext<'ast>>; +/// 'ast is the lifetime of the source code (input), 'buf is the lifetime of the buffer (output) +pub(crate) type PyFormatter<'ast, 'buf> = Formatter<'buf, PyFormatContext<'ast>>; /// Rule for formatting a JavaScript [`AstNode`]. pub(crate) trait FormatNodeRule