Remove some unused pub functions (#11576)

## Summary

I left anything in `red-knot`, any `with_` methods, etc.
This commit is contained in:
Charlie Marsh 2024-05-28 09:56:51 -04:00 committed by GitHub
parent 3989cb8b56
commit 16acd4913f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 7 additions and 495 deletions

View file

@ -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,