Conversation
examples/stop_symbol.rs
Outdated
| let mut sp = Spinner::new( | ||
| Spinners::from_str(&spinner_name).unwrap(), | ||
| "Waiting for 3 seconds".into(), | ||
| None, |
There was a problem hiding this comment.
@ad4mx can we keep our backward compatibility and make the parameter color with a default none value? so the upgrade of spinners will be painless?
There was a problem hiding this comment.
As far as I know, this is impossible in Rust, because you have to supply all needed arguments. I'll look more into it.
There was a problem hiding this comment.
Alright, I think moving it to a dedicated function would be a better idea then. I've also edited the code according to clippy.
| /// | ||
| /// let sp = Spinner::new_with_color(Spinners::Dots, String::new(), None); | ||
| /// ``` | ||
| pub fn with_timer_and_stream(spinner: Spinners, message: String, stream: Stream) -> Self { |
There was a problem hiding this comment.
the issue I'm having here is the cardinality of spinners crate options. For instance someone might want to have both a special stream AND a customized color.
While stream should be set everywhere, I think "color" is one special use-case of text customization and should be customizable through a text mapping function you can optionally set while creating a spinner.
Then we could update spinner create documentation to explain how to manage text colors.
From a library standpoint it makes way more sense don't you think?
Added colors for spinners. I didn't really like the
termcolorlibrary you recommended, and instead went with a simpler variant. Everything is tested and examples are updated.