diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index ba04ee8c5b1..1520767a01d 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -35,7 +35,7 @@ jobs: # ref: ${{ github.event.pull_request.head.sha }} - uses: actions-rs/toolchain@v1 with: - toolchain: 1.65.0 + toolchain: 1.66.0 profile: minimal - uses: Swatinem/rust-cache@v2 with: diff --git a/.github/workflows/moon.yml b/.github/workflows/moon.yml index 08c9426cc7a..4600b7dab3d 100644 --- a/.github/workflows/moon.yml +++ b/.github/workflows/moon.yml @@ -31,7 +31,7 @@ jobs: cache: yarn - uses: actions-rs/toolchain@v1 with: - toolchain: 1.65.0 + toolchain: 1.66.0 profile: minimal - uses: Swatinem/rust-cache@v2 with: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1b241966eda..a052a1d0f99 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -25,7 +25,7 @@ jobs: - uses: actions-rs/toolchain@v1 name: Setup toolchain with: - toolchain: 1.65.0 + toolchain: 1.66.0 profile: minimal components: rustfmt - uses: Swatinem/rust-cache@v2 @@ -48,7 +48,7 @@ jobs: - uses: actions-rs/toolchain@v1 name: Setup toolchain with: - toolchain: 1.65.0 + toolchain: 1.66.0 profile: minimal components: clippy - uses: Swatinem/rust-cache@v2 @@ -69,7 +69,7 @@ jobs: - uses: actions-rs/toolchain@v1 name: Setup toolchain with: - toolchain: 1.65.0 + toolchain: 1.66.0 profile: minimal components: llvm-tools-preview - name: Cache cargo diff --git a/crates/cli/src/commands/init/mod.rs b/crates/cli/src/commands/init/mod.rs index 80a1264912b..8323461c4ba 100644 --- a/crates/cli/src/commands/init/mod.rs +++ b/crates/cli/src/commands/init/mod.rs @@ -183,7 +183,7 @@ pub async fn init( // Create config files fs::write( - &moon_dir.join(CONFIG_TOOLCHAIN_FILENAME), + moon_dir.join(CONFIG_TOOLCHAIN_FILENAME), toolchain_configs .into_iter() .map(|c| c.trim().to_owned()) @@ -192,12 +192,12 @@ pub async fn init( )?; fs::write( - &moon_dir.join(CONFIG_WORKSPACE_FILENAME), + moon_dir.join(CONFIG_WORKSPACE_FILENAME), render_workspace_template(&context)?, )?; fs::write( - &moon_dir.join(CONFIG_GLOBAL_PROJECT_FILENAME), + moon_dir.join(CONFIG_GLOBAL_PROJECT_FILENAME), Tera::one_off(load_global_project_config_template(), &context, false)?, )?; diff --git a/crates/core/config/src/project/global_config.rs b/crates/core/config/src/project/global_config.rs index 5ed5e0cd51f..47f89e649c6 100644 --- a/crates/core/config/src/project/global_config.rs +++ b/crates/core/config/src/project/global_config.rs @@ -69,7 +69,7 @@ impl GlobalProjectConfig { let profile_name = "globalProject"; let mut config = GlobalProjectConfig::default(); - for source in gather_extended_sources(&path)? { + for source in gather_extended_sources(path)? { let figment = Figment::from(YamlExtended::file(source).profile(profile_name)); let extended_config = GlobalProjectConfig::load_config(figment.select(profile_name))?; diff --git a/crates/core/config/src/toolchain/config.rs b/crates/core/config/src/toolchain/config.rs index be5b0045e2a..b76cd9f59c0 100644 --- a/crates/core/config/src/toolchain/config.rs +++ b/crates/core/config/src/toolchain/config.rs @@ -42,7 +42,7 @@ impl ToolchainConfig { let mut figment = Figment::from(Serialized::defaults(ToolchainConfig::default()).profile(profile_name)); - for source in gather_extended_sources(&path)? { + for source in gather_extended_sources(path)? { figment = figment.merge(YamlExtended::file(source).profile(profile_name)); } diff --git a/crates/core/config/src/workspace/config.rs b/crates/core/config/src/workspace/config.rs index b6e3f2363d5..79e1bd39dce 100644 --- a/crates/core/config/src/workspace/config.rs +++ b/crates/core/config/src/workspace/config.rs @@ -104,7 +104,7 @@ impl WorkspaceConfig { let mut figment = Figment::from(Serialized::defaults(WorkspaceConfig::default()).profile(profile_name)); - for source in gather_extended_sources(&path)? { + for source in gather_extended_sources(path)? { figment = figment.merge(YamlExtended::file(source).profile(profile_name)); } diff --git a/crates/core/config/src/workspace/runner.rs b/crates/core/config/src/workspace/runner.rs index 4886e1870b7..86af50990f5 100644 --- a/crates/core/config/src/workspace/runner.rs +++ b/crates/core/config/src/workspace/runner.rs @@ -96,7 +96,7 @@ mod tests { fn load_jailed_config() -> Result { let figment = Figment::from(Serialized::defaults(RunnerConfig::default())) - .merge(YamlExtended::file(&PathBuf::from(CONFIG_FILENAME))); + .merge(YamlExtended::file(PathBuf::from(CONFIG_FILENAME))); let config: RunnerConfig = figment.extract()?; config diff --git a/crates/core/config/tests/local_project_test.rs b/crates/core/config/tests/local_project_test.rs index cae665edf22..f567d3e22f3 100644 --- a/crates/core/config/tests/local_project_test.rs +++ b/crates/core/config/tests/local_project_test.rs @@ -9,7 +9,7 @@ use std::collections::BTreeMap; use std::path::PathBuf; fn load_jailed_config() -> Result { - match ProjectConfig::load(&PathBuf::from(CONFIG_PROJECT_FILENAME)) { + match ProjectConfig::load(PathBuf::from(CONFIG_PROJECT_FILENAME)) { Ok(cfg) => Ok(cfg), Err(error) => Err(match error { ConfigError::FailedValidation(errors) => errors.first().unwrap().to_owned(), diff --git a/crates/core/config/tests/tasks_test.rs b/crates/core/config/tests/tasks_test.rs index 1cef854ae1a..8e3eff2f6ca 100644 --- a/crates/core/config/tests/tasks_test.rs +++ b/crates/core/config/tests/tasks_test.rs @@ -11,7 +11,7 @@ const CONFIG_FILENAME: &str = "tasks.yml"; // Not a config file, but we want to test in isolation fn load_jailed_config() -> Result { - let figment = Figment::new().merge(YamlExtended::file(&PathBuf::from(CONFIG_FILENAME))); + let figment = Figment::new().merge(YamlExtended::file(PathBuf::from(CONFIG_FILENAME))); let config: TaskConfig = figment.extract()?; config diff --git a/crates/core/config/tests/template_test.rs b/crates/core/config/tests/template_test.rs index aa6dc132043..001215ffeea 100644 --- a/crates/core/config/tests/template_test.rs +++ b/crates/core/config/tests/template_test.rs @@ -3,7 +3,7 @@ use moon_constants::CONFIG_TEMPLATE_FILENAME; use std::path::PathBuf; fn load_jailed_config() -> Result { - match TemplateConfig::load(&PathBuf::from(CONFIG_TEMPLATE_FILENAME)) { + match TemplateConfig::load(PathBuf::from(CONFIG_TEMPLATE_FILENAME)) { Ok(cfg) => Ok(cfg), Err(error) => Err(match error { ConfigError::FailedValidation(errors) => errors.first().unwrap().to_owned(), diff --git a/crates/core/logger/src/color.rs b/crates/core/logger/src/color.rs index 1f301c22ddf..e1a937df882 100644 --- a/crates/core/logger/src/color.rs +++ b/crates/core/logger/src/color.rs @@ -64,7 +64,7 @@ pub fn url>(url: T) -> String { } pub fn shell>(cmd: T) -> String { - paint(Color::Pink as u8, &clean_path(cmd)) + paint(Color::Pink as u8, clean_path(cmd)) } pub fn symbol>(value: T) -> String { diff --git a/crates/core/logger/src/logger.rs b/crates/core/logger/src/logger.rs index 244c63b01bc..1c92f3522fc 100644 --- a/crates/core/logger/src/logger.rs +++ b/crates/core/logger/src/logger.rs @@ -59,7 +59,7 @@ impl Logger { "{}{} {}{}", color::muted("["), color::log_level(record.level()), - color::muted(&formatted_timestamp), + color::muted(formatted_timestamp), color::muted("]"), ); diff --git a/crates/core/moon/src/lib.rs b/crates/core/moon/src/lib.rs index c4aaeb95dda..f3adba2cdff 100644 --- a/crates/core/moon/src/lib.rs +++ b/crates/core/moon/src/lib.rs @@ -10,7 +10,7 @@ use std::path::Path; use strum::IntoEnumIterator; pub fn register_platforms(workspace: &mut Workspace) { - workspace.register_platform(Box::new(SystemPlatform::default())); + workspace.register_platform(Box::::default()); if let Some(node_config) = &workspace.toolchain.config.node { workspace.register_platform(Box::new(NodePlatform::new(node_config, &workspace.root))); diff --git a/crates/core/project/tests/project_test.rs b/crates/core/project/tests/project_test.rs index 62209e22cc4..923bdc03fcb 100644 --- a/crates/core/project/tests/project_test.rs +++ b/crates/core/project/tests/project_test.rs @@ -314,7 +314,7 @@ mod tasks { // Expanded task.input_globs - .insert(glob::normalize(&workspace_root.join("tasks/no-tasks/**/*")).unwrap()); + .insert(glob::normalize(workspace_root.join("tasks/no-tasks/**/*")).unwrap()); assert_eq!( project, diff --git a/crates/core/runner/src/actions/run_target.rs b/crates/core/runner/src/actions/run_target.rs index bd3192a7ed3..33886e4c42e 100644 --- a/crates/core/runner/src/actions/run_target.rs +++ b/crates/core/runner/src/actions/run_target.rs @@ -195,7 +195,7 @@ impl<'a> TargetRunner<'a> { // Input globs are absolute paths, so we must do the same hashed_file_tree - .retain(|k, _| globset.matches(&workspace.root.join(k)).unwrap_or(false)); + .retain(|k, _| globset.matches(workspace.root.join(k)).unwrap_or(false)); hasher.hash_inputs(hashed_file_tree); } @@ -212,7 +212,7 @@ impl<'a> TargetRunner<'a> { .filter(|f| { // Deleted files will crash `git hash-object` !local_files.deleted.contains(f) - && globset.matches(&workspace.root.join(f)).unwrap_or(false) + && globset.matches(workspace.root.join(f)).unwrap_or(false) }) .collect::>(); @@ -346,7 +346,7 @@ impl<'a> TargetRunner<'a> { env_vars.insert( "MOON_PROJECT_RUNFILE".to_owned(), - path::to_string(&runfile.path)?, + path::to_string(runfile.path)?, ); Ok(env_vars) diff --git a/crates/core/runner/src/runner.rs b/crates/core/runner/src/runner.rs index c4cd22f527f..2a731e36ed5 100644 --- a/crates/core/runner/src/runner.rs +++ b/crates/core/runner/src/runner.rs @@ -324,7 +324,7 @@ impl Runner { let log_target_name = format!("{}:batch:{}:{}", LOG_TARGET, batch_count, action_count); - let log_action_label = color::muted_light(&node.label()); + let log_action_label = color::muted_light(node.label()); trace!( target: &log_target_name, diff --git a/crates/core/task/tests/token_test.rs b/crates/core/task/tests/token_test.rs index fbae58dccfe..309052d660c 100644 --- a/crates/core/task/tests/token_test.rs +++ b/crates/core/task/tests/token_test.rs @@ -406,7 +406,7 @@ mod args { resolver.resolve(&string_vec!["@in(0)"], &task).unwrap(), ( vec![], - vec![glob::normalize(&project_root.join("src/**/*")).unwrap()] + vec![glob::normalize(project_root.join("src/**/*")).unwrap()] ) ); } diff --git a/crates/core/utils/src/fs.rs b/crates/core/utils/src/fs.rs index 21e49cd03ee..13f92d4278e 100644 --- a/crates/core/utils/src/fs.rs +++ b/crates/core/utils/src/fs.rs @@ -149,7 +149,7 @@ pub fn read_dir_all + Send>(path: T) -> Result, for entry in entries { if let Ok(file_type) = entry.file_type() { if file_type.is_dir() { - results.extend(read_dir_all(&entry.path())?); + results.extend(read_dir_all(entry.path())?); } else { results.push(entry); } diff --git a/crates/core/utils/src/shell.rs b/crates/core/utils/src/shell.rs index 32ad3fe4806..e201866bfe7 100644 --- a/crates/core/utils/src/shell.rs +++ b/crates/core/utils/src/shell.rs @@ -10,6 +10,7 @@ fn is_program_on_path(program_name: String) -> bool { }; for path_dir in env::split_paths(&system_path) { + #[allow(clippy::needless_borrow)] if path_dir.join(&program_name).exists() { return true; } diff --git a/crates/core/workspace/src/workspace.rs b/crates/core/workspace/src/workspace.rs index b87d443126a..a1a5393eaad 100644 --- a/crates/core/workspace/src/workspace.rs +++ b/crates/core/workspace/src/workspace.rs @@ -46,7 +46,7 @@ fn load_global_project_config(root_dir: &Path) -> Result Result Result Result { let mut deps: LockfileDependencyVersions = FxHashMap::default(); - let yarn_lock_text = fs::read(&path)?; + let yarn_lock_text = fs::read(path)?; let entries: Vec = parse_str(&yarn_lock_text) .map_err(|e| MoonError::Generic(format!("Failed to parse lockfile: {}", e)))?; diff --git a/crates/node/platform/src/actions/install_deps.rs b/crates/node/platform/src/actions/install_deps.rs index c24d3b7b77b..efb9ea1253a 100644 --- a/crates/node/platform/src/actions/install_deps.rs +++ b/crates/node/platform/src/actions/install_deps.rs @@ -83,7 +83,7 @@ fn sync_workspace(workspace: &Workspace, node: &NodeTool) -> Result<(), MoonErro let rc_name = version_manager.get_config_filename(); let rc_path = workspace.root.join(&rc_name); - fs::write(&rc_path, &node.config.version)?; + fs::write(rc_path, &node.config.version)?; debug!( target: LOG_TARGET, diff --git a/crates/node/platform/src/actions/sync_project.rs b/crates/node/platform/src/actions/sync_project.rs index 47ddccf0b6a..76865134aa5 100644 --- a/crates/node/platform/src/actions/sync_project.rs +++ b/crates/node/platform/src/actions/sync_project.rs @@ -38,7 +38,7 @@ pub fn create_missing_tsconfig( let json = TsConfigJson { extends: Some(path::to_virtual_string( - path::relative_from(&tsconfig_options_path, &project.root).unwrap(), + path::relative_from(tsconfig_options_path, &project.root).unwrap(), )?), include: Some(string_vec!["**/*"]), references: Some(vec![]), @@ -293,7 +293,7 @@ pub async fn sync_project( tsconfig_json.update_compiler_options().out_dir = Some(path::to_virtual_string( - path::relative_from(&cache_route, &project.root).unwrap(), + path::relative_from(cache_route, &project.root).unwrap(), )?); } diff --git a/crates/typescript/lang/src/tsconfig.rs b/crates/typescript/lang/src/tsconfig.rs index 3d96fc440ca..c039a6a5cea 100644 --- a/crates/typescript/lang/src/tsconfig.rs +++ b/crates/typescript/lang/src/tsconfig.rs @@ -160,7 +160,7 @@ pub fn load_to_value>(path: T, extend: bool) -> Result