mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00
Remove some unused pub
functions (#11576)
## Summary I left anything in `red-knot`, any `with_` methods, etc.
This commit is contained in:
parent
3989cb8b56
commit
16acd4913f
14 changed files with 7 additions and 495 deletions
|
@ -50,11 +50,6 @@ pub struct UnicodeEscape<'a> {
|
|||
}
|
||||
|
||||
impl<'a> UnicodeEscape<'a> {
|
||||
#[inline]
|
||||
pub fn with_forced_quote(source: &'a str, quote: Quote) -> Self {
|
||||
let layout = EscapeLayout { quote, len: None };
|
||||
Self { source, layout }
|
||||
}
|
||||
#[inline]
|
||||
pub fn with_preferred_quote(source: &'a str, quote: Quote) -> Self {
|
||||
let layout = Self::repr_layout(source, quote);
|
||||
|
@ -240,11 +235,6 @@ impl<'a> AsciiEscape<'a> {
|
|||
Self { source, layout }
|
||||
}
|
||||
#[inline]
|
||||
pub fn with_forced_quote(source: &'a [u8], quote: Quote) -> Self {
|
||||
let layout = EscapeLayout { quote, len: None };
|
||||
Self { source, layout }
|
||||
}
|
||||
#[inline]
|
||||
pub fn with_preferred_quote(source: &'a [u8], quote: Quote) -> Self {
|
||||
let layout = Self::repr_layout(source, quote);
|
||||
Self { source, layout }
|
||||
|
@ -271,17 +261,6 @@ impl AsciiEscape<'_> {
|
|||
})
|
||||
}
|
||||
|
||||
#[allow(
|
||||
clippy::cast_possible_wrap,
|
||||
clippy::cast_possible_truncation,
|
||||
clippy::cast_sign_loss
|
||||
)]
|
||||
pub fn named_repr_layout(source: &[u8], name: &str) -> EscapeLayout {
|
||||
Self::output_layout_with_checker(source, Quote::Single, name.len() + 2 + 3, |a, b| {
|
||||
Some((a as isize).checked_add(b as isize)? as usize)
|
||||
})
|
||||
}
|
||||
|
||||
fn output_layout_with_checker(
|
||||
source: &[u8],
|
||||
preferred_quote: Quote,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue