mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Disallow unreachable_pub
(#4314)
This commit is contained in:
parent
97802e7466
commit
c10a4535b9
444 changed files with 1376 additions and 1106 deletions
|
@ -64,7 +64,7 @@ pub(super) struct UniqueGroupIdBuilder {
|
|||
|
||||
impl UniqueGroupIdBuilder {
|
||||
/// Creates a new unique group id with the given debug name.
|
||||
pub fn group_id(&self, debug_name: &'static str) -> GroupId {
|
||||
pub(crate) fn group_id(&self, debug_name: &'static str) -> GroupId {
|
||||
let id = self.next_id.fetch_add(1, Ordering::Relaxed);
|
||||
let id = NonZeroU32::new(id).unwrap_or_else(|| panic!("Group ID counter overflowed"));
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ pub(super) struct PrintElementArgs {
|
|||
}
|
||||
|
||||
impl PrintElementArgs {
|
||||
pub fn new(indent: Indention) -> Self {
|
||||
pub(crate) fn new(indent: Indention) -> Self {
|
||||
Self {
|
||||
indent,
|
||||
..Self::default()
|
||||
|
@ -46,27 +46,27 @@ impl PrintElementArgs {
|
|||
self.indent
|
||||
}
|
||||
|
||||
pub fn increment_indent_level(mut self, indent_style: IndentStyle) -> Self {
|
||||
pub(crate) fn increment_indent_level(mut self, indent_style: IndentStyle) -> Self {
|
||||
self.indent = self.indent.increment_level(indent_style);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn decrement_indent(mut self) -> Self {
|
||||
pub(crate) fn decrement_indent(mut self) -> Self {
|
||||
self.indent = self.indent.decrement();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn reset_indent(mut self) -> Self {
|
||||
pub(crate) fn reset_indent(mut self) -> Self {
|
||||
self.indent = Indention::default();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn set_indent_align(mut self, count: NonZeroU8) -> Self {
|
||||
pub(crate) fn set_indent_align(mut self, count: NonZeroU8) -> Self {
|
||||
self.indent = self.indent.set_align(count);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_print_mode(mut self, mode: PrintMode) -> Self {
|
||||
pub(crate) fn with_print_mode(mut self, mode: PrintMode) -> Self {
|
||||
self.mode = mode;
|
||||
self
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue