mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 14:21:53 +00:00
[red-knot] Add a read_directory()
method to the ruff_db::system::System
trait (#12289)
This commit is contained in:
parent
17e84d5f40
commit
6febd96dfe
7 changed files with 239 additions and 4 deletions
|
@ -303,6 +303,12 @@ impl SystemPath {
|
|||
self.0.as_std_path()
|
||||
}
|
||||
|
||||
/// Returns the [`Utf8Path`] for the file.
|
||||
#[inline]
|
||||
pub fn as_utf8_path(&self) -> &Utf8Path {
|
||||
&self.0
|
||||
}
|
||||
|
||||
pub fn from_std_path(path: &Path) -> Option<&SystemPath> {
|
||||
Some(SystemPath::new(Utf8Path::from_path(path)?))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue