infra: add clippy allows; fix PathBuf -> Path
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I07795374f678fa2ec17b4171fa7e32276a6a6964
This commit is contained in:
parent
27160a1eda
commit
b71b2862c9
3 changed files with 18 additions and 14 deletions
|
|
@ -288,10 +288,9 @@ pub fn detect_vcs_type<P: AsRef<Path>>(path: P) -> VcsType {
|
||||||
.args(["root"])
|
.args(["root"])
|
||||||
.current_dir(path)
|
.current_dir(path)
|
||||||
.output()
|
.output()
|
||||||
|
&& output.status.success()
|
||||||
{
|
{
|
||||||
if output.status.success() {
|
return VcsType::Jujutsu;
|
||||||
return VcsType::Jujutsu;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for git
|
// Check for git
|
||||||
|
|
@ -299,10 +298,9 @@ pub fn detect_vcs_type<P: AsRef<Path>>(path: P) -> VcsType {
|
||||||
.args(["rev-parse", "--show-toplevel"])
|
.args(["rev-parse", "--show-toplevel"])
|
||||||
.current_dir(path)
|
.current_dir(path)
|
||||||
.output()
|
.output()
|
||||||
|
&& output.status.success()
|
||||||
{
|
{
|
||||||
if output.status.success() {
|
return VcsType::Git;
|
||||||
return VcsType::Git;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsType::None
|
VcsType::None
|
||||||
|
|
@ -333,7 +331,7 @@ pub fn repo_has_uncommitted_changes<P: AsRef<Path>>(path: P) -> Result<bool> {
|
||||||
.current_dir(path)
|
.current_dir(path)
|
||||||
.output()
|
.output()
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
PakkerError::GitError(format!("Failed to run jj status: {}", e))
|
PakkerError::GitError(format!("Failed to run jj status: {e}"))
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let output_str = String::from_utf8_lossy(&output.stdout);
|
let output_str = String::from_utf8_lossy(&output.stdout);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
// Allow pre-existing clippy warnings for functions with many arguments
|
||||||
|
// and complex types that would require significant refactoring
|
||||||
|
#![allow(clippy::too_many_arguments)]
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
#![allow(clippy::large_enum_variant)]
|
||||||
|
|
||||||
mod cli;
|
mod cli;
|
||||||
mod error;
|
mod error;
|
||||||
mod export;
|
mod export;
|
||||||
|
|
|
||||||
|
|
@ -80,13 +80,13 @@ impl RateLimiter {
|
||||||
platform_requests
|
platform_requests
|
||||||
.retain(|t| now.duration_since(*t) < Duration::from_secs(60));
|
.retain(|t| now.duration_since(*t) < Duration::from_secs(60));
|
||||||
|
|
||||||
if platform_requests.len() >= burst as usize {
|
if platform_requests.len() >= burst as usize
|
||||||
if let Some(oldest) = platform_requests.first() {
|
&& let Some(oldest) = platform_requests.first()
|
||||||
let wait_time = interval.saturating_sub(now.duration_since(*oldest));
|
{
|
||||||
if wait_time > Duration::ZERO {
|
let wait_time = interval.saturating_sub(now.duration_since(*oldest));
|
||||||
drop(inner);
|
if wait_time > Duration::ZERO {
|
||||||
tokio::time::sleep(wait_time).await;
|
drop(inner);
|
||||||
}
|
tokio::time::sleep(wait_time).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue