mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
refactor(wgsl-out): use for loop for function arg. writing
This commit is contained in:
committed by
Connor Fitzgerald
parent
469272c613
commit
df4e40327c
@@ -1609,15 +1609,7 @@ impl<W: Write> Writer<W> {
|
||||
Function::Regular(fun_name) => {
|
||||
write!(self.out, "{}(", fun_name)?;
|
||||
self.write_expr(module, arg, func_ctx)?;
|
||||
if let Some(arg) = arg1 {
|
||||
write!(self.out, ", ")?;
|
||||
self.write_expr(module, arg, func_ctx)?;
|
||||
}
|
||||
if let Some(arg) = arg2 {
|
||||
write!(self.out, ", ")?;
|
||||
self.write_expr(module, arg, func_ctx)?;
|
||||
}
|
||||
if let Some(arg) = arg3 {
|
||||
for arg in IntoIterator::into_iter([arg1, arg2, arg3]).flatten() {
|
||||
write!(self.out, ", ")?;
|
||||
self.write_expr(module, arg, func_ctx)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user