Re: [rust-dev] Extending struct and trait

2019-04-26 Thread Corey Richardson
Hi Nadav,

This list is defunct. You should use users.rust-lang.org. See 
https://www.rust-lang.org/community
for other places to communicate.

On Fri, Apr 26, 2019, at 07:03, Nadav Vinik wrote:
> Hello
> 
> I don't know why you don't want to implement heritage of classes but it 
> will be easier if will be a macro like: implement_trait_on 
> object(trait, self.c, except_methods)!
> 
> for example:
> 
> fn get_homogeneous(&self) -> bool {
>  self.c.get_homogeneous()
> }
> 
> Rust complain about missing 1 parameter but it not display what the 
> missing parameter.
> In the trait there is only one parameter.
> 
> ---
> error[E0049]: method `set_center_widget` has 1 type parameter but its 
> trait declaration has 2 type parameters
>  --> src/widget.rs:63:25
>  |
> 63 | fn set_center_widget>(&self, widget: 
> Option<&P>) 
>  | ^ found 1 type parameter, expected 2
> ---
> 
> See at:
> https://users.rust-lang.org/t/i-implement-method-trait-with-two-params-but-rust-insist-that-i-have-only-one/27643
> 
> Thanks
> ___
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>

-- 
cmr
http://octayn.net/
+16038524272
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev


[rust-dev] Extending struct and trait

2019-04-26 Thread Nadav Vinik
Hello

I don't know why you don't want to implement heritage of classes but it
will be easier if will be a macro like: implement_trait_on object(trait,
self.c, except_methods)!

for example:

fn get_homogeneous(&self) -> bool {
 self.c.get_homogeneous()
}

Rust complain about missing 1 parameter but it not display what the missing
parameter.
In the trait there is only one parameter.

---
error[E0049]: method `set_center_widget` has 1 type parameter but its trait
declaration has 2 type parameters
  --> src/widget.rs:63:25
   |
63 | fn set_center_widget>(&self, widget:
Option<&P>)
   | ^ found 1 type parameter,
expected 2
---

See at:
https://users.rust-lang.org/t/i-implement-method-trait-with-two-params-but-rust-insist-that-i-have-only-one/27643

Thanks
___
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev