Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: run clippy #6159

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions crates/turborepo-auth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,8 @@ async fn run_sso_one_shot_server(

#[cfg(test)]
mod test {
use port_scanner;

use reqwest::Url;
use tokio;
use turborepo_ui::UI;
use turborepo_vercel_api_mock::start_test_server;

Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-cache/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ mod test {
duration,
} = test_case;

let api_client = APIClient::new(&format!("http://localhost:{}", port), 200, "2.0.0", true)?;
let api_client = APIClient::new(format!("http://localhost:{}", port), 200, "2.0.0", true)?;
let opts = CacheOpts::default();
let api_auth = APIAuth {
team_id: "my-team".to_string(),
Expand Down
6 changes: 3 additions & 3 deletions crates/turborepo-lib/src/config/turbo_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ mod test {
assert_eq!(defaults.team_slug(), None);
assert_eq!(defaults.team_id(), None);
assert_eq!(defaults.token(), None);
assert_eq!(defaults.signature(), false);
assert_eq!(defaults.enabled(), true);
assert_eq!(defaults.preflight(), false);
assert!(!defaults.signature());
assert!(defaults.enabled());
assert!(!defaults.preflight());
assert_eq!(defaults.timeout(), DEFAULT_TIMEOUT);
}

Expand Down
12 changes: 2 additions & 10 deletions crates/turborepo-lib/src/tracing.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
use std::{
marker::PhantomData,
path::Path,
rc::Rc,
sync::{Arc, Mutex},
};
use std::{marker::PhantomData, path::Path, sync::Mutex};

use chrono::Local;
use owo_colors::{
colors::{Black, Default, Red, Yellow},
Color, OwoColorize,
};
use tracing::{field::Visit, metadata::LevelFilter, trace, Event, Level, Subscriber};
use tracing_appender::{
non_blocking::{NonBlocking, WorkerGuard},
rolling::RollingFileAppender,
};
use tracing_appender::{non_blocking::NonBlocking, rolling::RollingFileAppender};
use tracing_chrome::ChromeLayer;
use tracing_subscriber::{
filter::{Filtered, Targets},
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-pidlock/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl Pidlock {
})?;
Ok(Some(pid))
}
Ok(pid) => {
Ok(_pid) => {
warn!("stale pid file at {:?}", self.path);
if let Err(e) = fs::remove_file(&self.path) {
Err(PidFileError::FailedDelete(
Expand Down
6 changes: 3 additions & 3 deletions crates/turborepo-repository/src/inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ impl RepoState {
.filter_map(|path| {
PackageJson::load(&path.join_component("package.json"))
.ok()
.and_then(|package_json| {
.map(|package_json| {
// FIXME: We should save this package manager that we detected
let workspace_globs =
PackageManager::get_package_manager(path, Some(&package_json))
.and_then(|mgr| mgr.get_workspace_globs(path))
.ok();

Some(InferInfo {
InferInfo {
path: path.to_owned(),
workspace_globs,
})
}
})
})
.reduce(|current, candidate| {
Expand Down
4 changes: 2 additions & 2 deletions crates/turborepo-scm/src/manual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ mod tests {

let root_ignore_file = turbo_root.join_component(".gitignore");
root_ignore_file
.create_with_contents(&root_ignore_contents)
.create_with_contents(root_ignore_contents)
.unwrap();
let pkg_ignore_file = turbo_root.resolve(&pkg_path).join_component(".gitignore");
pkg_ignore_file.ensure_dir().unwrap();
pkg_ignore_file
.create_with_contents(&pkg_ignore_contents)
.create_with_contents(pkg_ignore_contents)
.unwrap();

let mut expected = GitHashes::new();
Expand Down
Loading