mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-17 18:57:30 +00:00
Make the use of Self consistent. (#15074)
## Summary Make the use of `Self` consistent. Mostly done by running `cargo clippy --fix -- -A clippy::all -W clippy::use_self`. ## Test Plan <!-- How was it tested? --> No need.
This commit is contained in:
parent
57f900ad0d
commit
3f83390e34
121 changed files with 1305 additions and 1376 deletions
|
|
@ -161,20 +161,20 @@ pub(crate) struct GitRepository {
|
|||
|
||||
impl GitRepository {
|
||||
/// Opens an existing Git repository at `path`.
|
||||
pub(crate) fn open(path: &Path) -> Result<GitRepository> {
|
||||
pub(crate) fn open(path: &Path) -> Result<Self> {
|
||||
// Make sure there is a Git repository at the specified path.
|
||||
ProcessBuilder::new(GIT.as_ref()?)
|
||||
.arg("rev-parse")
|
||||
.cwd(path)
|
||||
.exec_with_output()?;
|
||||
|
||||
Ok(GitRepository {
|
||||
Ok(Self {
|
||||
path: path.to_path_buf(),
|
||||
})
|
||||
}
|
||||
|
||||
/// Initializes a Git repository at `path`.
|
||||
fn init(path: &Path) -> Result<GitRepository> {
|
||||
fn init(path: &Path) -> Result<Self> {
|
||||
// TODO(ibraheem): see if this still necessary now that we no longer use libgit2
|
||||
// Skip anything related to templates, they just call all sorts of issues as
|
||||
// we really don't want to use them yet they insist on being used. See #6240
|
||||
|
|
@ -187,7 +187,7 @@ impl GitRepository {
|
|||
.cwd(path)
|
||||
.exec_with_output()?;
|
||||
|
||||
Ok(GitRepository {
|
||||
Ok(Self {
|
||||
path: path.to_path_buf(),
|
||||
})
|
||||
}
|
||||
|
|
@ -392,7 +392,7 @@ impl GitCheckout {
|
|||
}
|
||||
|
||||
let repo = GitRepository::open(into)?;
|
||||
let checkout = GitCheckout::new(revision, repo);
|
||||
let checkout = Self::new(revision, repo);
|
||||
checkout.reset()?;
|
||||
Ok(checkout)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue