Repository: brendanzab/gl-rs (language: rust)

Issue:
Stdweb generator should use @(no_return)
WebGL methods that aren't expected to return anything should use the `@(no_return) ` hint, to avoid the overhead of passing their return values back to Rust unnecessarily.

e.g.

```rust
pub fn clear(&self, mask: GLbitfield) {
    js!( @{self}.clear(@{mask}); );
}
```

should be

```rust
pub fn clear(&self, mask: GLbitfield) {
    js!(
        @(no_return)
        @{self}.clear(@{mask});
    );
}
```


Discussion / hints:
Thanks for the report! cc. @Diggsey

Fix patch:
diff --git a/webgl_generator/webgl_generators/stdweb_gen.rs b/webgl_generator/webgl_generators/stdweb_gen.rs
index 631c380c..5125b4c8 100644
--- a/webgl_generator/webgl_generators/stdweb_gen.rs
+++ b/webgl_generator/webgl_generators/stdweb_gen.rs
@@ -687,7 +687,7 @@ where
             r#"
 
     pub fn set_{name}{gargs}(&self, value: {type_}){gwhere} {{
-        js!( @{{self}}.{raw_name} = @{{{value}}}; );
+        js!( @(no_return) @{{self}}.{raw_name} = @{{{value}}}; );
     }}"#,
             name = snake(name),
             raw_name = name,
@@ -793,7 +793,7 @@ where
             r#"
 
     {doc_comment}pub fn {name}{gargs}(&self, {args}){gwhere} {{
-        js!( @{{self}}.{raw_name}({js_args}); );
+        js!( @(no_return) @{{self}}.{raw_name}({js_args}); );
     }}"#,
             name = rust_name,
             raw_name = name,


Test patch: