Use consistent re-export from ruff_source_file (#9320)

Right now, we both re-export (via `pub use`) and mark the modules
themselves a `pub`, so they can be imported through two different paths.
This commit is contained in:
Charlie Marsh 2023-12-30 15:48:45 -04:00 committed by GitHub
parent c01bb0d485
commit eb9a1bc5f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View file

@ -2,21 +2,22 @@ use std::cmp::Ordering;
use std::fmt::{Debug, Formatter};
use std::sync::Arc;
use ruff_text_size::{Ranged, TextRange, TextSize};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
pub mod line_index;
mod locator;
pub mod newlines;
use ruff_text_size::{Ranged, TextRange, TextSize};
pub use crate::line_index::{LineIndex, OneIndexed};
pub use locator::Locator;
pub use newlines::{
pub use crate::locator::Locator;
pub use crate::newlines::{
find_newline, Line, LineEnding, NewlineWithTrailingNewline, UniversalNewlineIterator,
UniversalNewlines,
};
mod line_index;
mod locator;
mod newlines;
/// Gives access to the source code of a file and allows mapping between [`TextSize`] and [`SourceLocation`].
#[derive(Debug)]
pub struct SourceCode<'src, 'index> {