From 78e77cd75d14728ad9d7ebadef080ecc80346553 Mon Sep 17 00:00:00 2001 From: Charlotte McElwain Date: Thu, 9 Nov 2023 20:56:25 -0800 Subject: [PATCH] Rustfmt. --- plugins/sop/generator-sop/src/lib.rs | 1 - td-rs-base/src/param.rs | 12 ++++++++---- td-rs-derive/src/lib.rs | 1 - td-rs-xtask/src/macos/mod.rs | 13 +++++++------ td-rs-xtask/src/metadata.rs | 10 ++++++++-- td-rs-xtask/src/windows/mod.rs | 13 +++++++++++-- 6 files changed, 34 insertions(+), 16 deletions(-) diff --git a/plugins/sop/generator-sop/src/lib.rs b/plugins/sop/generator-sop/src/lib.rs index 1372149..62097b1 100644 --- a/plugins/sop/generator-sop/src/lib.rs +++ b/plugins/sop/generator-sop/src/lib.rs @@ -78,7 +78,6 @@ impl Sop for GeneratorSop { } fn execute_vbo(&mut self, output: SopVboOutput, _inputs: &OperatorInputs) { - let mut output = match self.params.shape { Shape::Point => { let mut output = output.alloc_all(1, 1, 1, BufferMode::Static); diff --git a/td-rs-base/src/param.rs b/td-rs-base/src/param.rs index 041a1fa..e41677d 100644 --- a/td-rs-base/src/param.rs +++ b/td-rs-base/src/param.rs @@ -587,7 +587,8 @@ impl Param for ChopParam { impl ChopParam { /// Get the chop input for this parameter, if it exists. pub fn input(&self) -> Option<&ChopInput> { - self.input.map(|input| unsafe { ChopInput::ref_cast(&*input) }) + self.input + .map(|input| unsafe { ChopInput::ref_cast(&*input) }) } } @@ -610,7 +611,8 @@ impl Param for SopParam { impl SopParam { /// Get the sop input for this parameter, if it exists. pub fn input(&self) -> Option<&SopInput> { - self.input.map(|input| unsafe { SopInput::ref_cast(&*input) }) + self.input + .map(|input| unsafe { SopInput::ref_cast(&*input) }) } } @@ -633,7 +635,8 @@ impl Param for TopParam { impl TopParam { /// Get the top input for this parameter, if it exists. pub fn input(&self) -> Option<&crate::top::TopInput> { - self.input.map(|input| unsafe { crate::top::TopInput::ref_cast(&*input) }) + self.input + .map(|input| unsafe { crate::top::TopInput::ref_cast(&*input) }) } } @@ -656,7 +659,8 @@ impl Param for DatParam { impl DatParam { /// Get the dat input for this parameter, if it exists. pub fn input(&self) -> Option<&crate::dat::DatInput> { - self.input.map(|input| unsafe { crate::dat::DatInput::ref_cast(&*input) }) + self.input + .map(|input| unsafe { crate::dat::DatInput::ref_cast(&*input) }) } } diff --git a/td-rs-derive/src/lib.rs b/td-rs-derive/src/lib.rs index 0b107bf..4d5e122 100644 --- a/td-rs-derive/src/lib.rs +++ b/td-rs-derive/src/lib.rs @@ -2,7 +2,6 @@ extern crate proc_macro; use proc_macro::TokenStream; - use quote::quote; use syn::{ diff --git a/td-rs-xtask/src/macos/mod.rs b/td-rs-xtask/src/macos/mod.rs index 3c2f58c..72354ff 100644 --- a/td-rs-xtask/src/macos/mod.rs +++ b/td-rs-xtask/src/macos/mod.rs @@ -1,10 +1,10 @@ -use std::fs::metadata; use crate::config::Config; use crate::metadata::PluginType; use crate::{build, PLUGIN_HOME}; use anyhow::Context; use fs_extra::dir::CopyOptions; use plist::Value; +use std::fs::metadata; use std::path::{Path, PathBuf}; use std::process::Command; @@ -91,7 +91,11 @@ fn build_xcode(config: &Config, plugin: &str, is_python_enabled: bool) -> anyhow "PYTHON_INCLUDE_DIR={}", config.macos.python_include_dir )) - .arg(if is_python_enabled {"EXTRA_CFLAGS=-DPYTHON_ENABLED"} else {""}) + .arg(if is_python_enabled { + "EXTRA_CFLAGS=-DPYTHON_ENABLED" + } else { + "" + }) .spawn() .expect("ls command failed to start"); cmd.wait().unwrap(); @@ -139,10 +143,7 @@ fn write_xcodeproj( .as_dictionary_mut() .unwrap(); bundle_config.insert("name".to_string(), Value::String(plugin.to_string())); - bundle_config.insert( - "productName".to_string(), - Value::String(plugin.to_string()), - ); + bundle_config.insert("productName".to_string(), Value::String(plugin.to_string())); project.to_file_xml(path)?; Ok(()) } diff --git a/td-rs-xtask/src/metadata.rs b/td-rs-xtask/src/metadata.rs index c24623f..f0faa60 100644 --- a/td-rs-xtask/src/metadata.rs +++ b/td-rs-xtask/src/metadata.rs @@ -108,8 +108,14 @@ pub(crate) fn list_plugins() -> anyhow::Result> { pub fn is_python_enabled(plugin: &str, plugin_type: &PluginType) -> bool { let pkg = crate::metadata::fetch_cargo_workspace_package(plugin).unwrap(); - let parent_dep = pkg.dependencies.iter() + let parent_dep = pkg + .dependencies + .iter() .find(|dep| dep.name == plugin_type.to_plugin_name()) .expect("Could not find plugin dependency"); - parent_dep.features.iter().find(|feature| feature == &"python").is_some() + parent_dep + .features + .iter() + .find(|feature| feature == &"python") + .is_some() } diff --git a/td-rs-xtask/src/windows/mod.rs b/td-rs-xtask/src/windows/mod.rs index c52072d..4781246 100644 --- a/td-rs-xtask/src/windows/mod.rs +++ b/td-rs-xtask/src/windows/mod.rs @@ -86,7 +86,12 @@ fn plugin_target_path(plugin: &str) -> PathBuf { plugin_target_path } -fn run_msbuild(config: &Config, target: &str, plugin: &str, is_python_enabled: bool) -> anyhow::Result<()> { +fn run_msbuild( + config: &Config, + target: &str, + plugin: &str, + is_python_enabled: bool, +) -> anyhow::Result<()> { let msbuild = find_msbuild()?; let msbuild = msbuild.to_str().expect("Could not find msbuild"); let lib = format!("{}.lib", plugin.replace("-", "_")); @@ -95,7 +100,11 @@ fn run_msbuild(config: &Config, target: &str, plugin: &str, is_python_enabled: b let mut cmd = Command::new(msbuild) .arg(format!("/p:AdditionalIncludeDirectories={py_include}")) .arg(format!("/p:AdditionalLibraryDirectories={py_lib}")) - .arg(if is_python_enabled {"/p:PreprocessorDefinitions=PYTHON_ENABLED"} else {""}) + .arg(if is_python_enabled { + "/p:PreprocessorDefinitions=PYTHON_ENABLED" + } else { + "" + }) .arg("/p:Configuration=Release") .arg("/t:Rebuild") .arg("/p:Platform=x64")