mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
[ty] Support ephemeral uv virtual environments (#18335)
This commit is contained in:
parent
9925910a29
commit
a5ebb3f3a2
6 changed files with 283 additions and 97 deletions
|
@ -596,6 +596,13 @@ impl AsRef<SystemPath> for Utf8PathBuf {
|
|||
}
|
||||
}
|
||||
|
||||
impl AsRef<SystemPath> for camino::Utf8Component<'_> {
|
||||
#[inline]
|
||||
fn as_ref(&self) -> &SystemPath {
|
||||
SystemPath::new(self.as_str())
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<SystemPath> for str {
|
||||
#[inline]
|
||||
fn as_ref(&self) -> &SystemPath {
|
||||
|
@ -626,6 +633,22 @@ impl Deref for SystemPathBuf {
|
|||
}
|
||||
}
|
||||
|
||||
impl<P: AsRef<SystemPath>> FromIterator<P> for SystemPathBuf {
|
||||
fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> Self {
|
||||
let mut buf = SystemPathBuf::new();
|
||||
buf.extend(iter);
|
||||
buf
|
||||
}
|
||||
}
|
||||
|
||||
impl<P: AsRef<SystemPath>> Extend<P> for SystemPathBuf {
|
||||
fn extend<I: IntoIterator<Item = P>>(&mut self, iter: I) {
|
||||
for path in iter {
|
||||
self.push(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for SystemPath {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
self.0.fmt(f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue