Skip to content

Commit f5f7ddf

Browse files
LaBatata101MichaReiser
authored andcommitted
remove not_yet_implemented_custom_text function
1 parent 1983ef7 commit f5f7ddf

File tree

1 file changed

+1
-42
lines changed
  • crates/ruff_python_formatter/src

1 file changed

+1
-42
lines changed

crates/ruff_python_formatter/src/lib.rs

+1-42
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
use thiserror::Error;
22

3-
use ruff_formatter::format_element::tag;
43
use ruff_formatter::prelude::*;
54
use ruff_formatter::{format, FormatError, Formatted, PrintError, Printed, SourceCode};
6-
use ruff_python_ast::node::{AnyNodeRef, AstNode};
5+
use ruff_python_ast::node::AstNode;
76
use ruff_python_ast::Mod;
87
use ruff_python_index::{CommentRanges, CommentRangesBuilder};
98
use ruff_python_parser::lexer::{lex, LexicalError};
109
use ruff_python_parser::{parse_tokens, Mode, ParseError};
1110
use ruff_source_file::Locator;
12-
use ruff_text_size::TextLen;
1311

1412
use crate::comments::{
1513
dangling_comments, leading_comments, trailing_comments, Comments, SourceComment,
@@ -178,45 +176,6 @@ pub fn pretty_comments(formatted: &Formatted<PyFormatContext>, source: &str) ->
178176
)
179177
}
180178

181-
pub(crate) struct NotYetImplementedCustomText<'a> {
182-
text: &'static str,
183-
node: AnyNodeRef<'a>,
184-
}
185-
186-
/// Formats a placeholder for nodes that have not yet been implemented
187-
pub(crate) fn not_yet_implemented_custom_text<'a, T>(
188-
text: &'static str,
189-
node: T,
190-
) -> NotYetImplementedCustomText<'a>
191-
where
192-
T: Into<AnyNodeRef<'a>>,
193-
{
194-
NotYetImplementedCustomText {
195-
text,
196-
node: node.into(),
197-
}
198-
}
199-
200-
impl Format<PyFormatContext<'_>> for NotYetImplementedCustomText<'_> {
201-
fn fmt(&self, f: &mut PyFormatter) -> FormatResult<()> {
202-
f.write_element(FormatElement::Tag(Tag::StartVerbatim(
203-
tag::VerbatimKind::Verbatim {
204-
length: self.text.text_len(),
205-
},
206-
)));
207-
208-
text(self.text).fmt(f)?;
209-
210-
f.write_element(FormatElement::Tag(Tag::EndVerbatim));
211-
212-
f.context()
213-
.comments()
214-
.mark_verbatim_node_comments_formatted(self.node);
215-
216-
Ok(())
217-
}
218-
}
219-
220179
#[cfg(test)]
221180
mod tests {
222181
use std::path::Path;

0 commit comments

Comments
 (0)