You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use spinoff::{spinners,Color,SpinnerasLibSpinner};pubstructSpinner{msg:String,sp:LibSpinner,}implSpinner{pubfnnew(msg:&String) -> Self{Self{msg: msg.clone(),sp:create_standard_spinner(&msg),}}pubfnsuccess(&mutself){self.sp.success(&self.msg);}}fncreate_standard_spinner(msg:&String) -> LibSpinner{LibSpinner::new(spinners::Dots2, msg.clone(),Color::Blue)}pubfncreate_spinner(msg:&String) -> Spinner{Spinner::new(msg)}
but it results in the following error
error[E0507]: cannot move out of `self.sp` which is behind a mutable reference
--> shared/commands-helper/src/lib.rs:23:13
|
23 | self.sp.success(&self.msg);| ^^^^^^^ move occurs because `self.sp` has type`spinoff::Spinner`, which does not implement the `Copy` trait
For more information about this error, try `rustc --explain E0507`.
^^^^
The text was updated successfully, but these errors were encountered:
Hi, this will not be possible, since the struct every spinner is built on, SpinnerFrames, has a field with a Vec<&'static str>, so I can't implement the Copy trait on it. You can clone it however.
Is your feature request related to a problem? Please describe.
Cannot implement Facade pattern because there is no implementation of the Copy trait 🤕
Describe the solution you'd like
implement copy/clone (I'm new to rust, please forgive me if it doesn't makes sense 🙏 )
Describe alternatives you've considered
using spinners lib for facade (it worked ✅ )
Additional context
but it results in the following error
The text was updated successfully, but these errors were encountered: