Skip to content

Commit

Permalink
Rustfmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
tychedelia committed Nov 10, 2023
1 parent beeaa63 commit 78e77cd
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 16 deletions.
1 change: 0 additions & 1 deletion plugins/sop/generator-sop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ impl Sop for GeneratorSop {
}

fn execute_vbo(&mut self, output: SopVboOutput<Unalloc>, _inputs: &OperatorInputs<SopInput>) {

let mut output = match self.params.shape {
Shape::Point => {
let mut output = output.alloc_all(1, 1, 1, BufferMode::Static);
Expand Down
12 changes: 8 additions & 4 deletions td-rs-base/src/param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) })
}
}

Expand All @@ -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) })
}
}

Expand All @@ -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) })
}
}

Expand All @@ -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) })
}
}

Expand Down
1 change: 0 additions & 1 deletion td-rs-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ extern crate proc_macro;

use proc_macro::TokenStream;


use quote::quote;

use syn::{
Expand Down
13 changes: 7 additions & 6 deletions td-rs-xtask/src/macos/mod.rs
Original file line number Diff line number Diff line change
@@ -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;

Check warning on line 7 in td-rs-xtask/src/macos/mod.rs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

unused import: `std::fs::metadata`
use std::path::{Path, PathBuf};
use std::process::Command;

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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(())
}
10 changes: 8 additions & 2 deletions td-rs-xtask/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ pub(crate) fn list_plugins() -> anyhow::Result<Vec<String>> {

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()
}
13 changes: 11 additions & 2 deletions td-rs-xtask/src/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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("-", "_"));
Expand All @@ -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")
Expand Down

0 comments on commit 78e77cd

Please sign in to comment.