Use map instead of pushing to a new vec
This commit is contained in:
parent
3058f92f8b
commit
ae1074c601
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -4,7 +4,7 @@ version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "circe"
|
name = "circe"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "circe"
|
name = "circe"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
description = "IRC crate in Rust"
|
description = "IRC crate in Rust"
|
||||||
|
|
|
@ -403,10 +403,7 @@ impl Config {
|
||||||
username: &str,
|
username: &str,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
// Conversion from &'static str to String
|
// Conversion from &'static str to String
|
||||||
let mut channels_config = Vec::new();
|
let channels_config = channels.iter().map(|channel| channel.to_string()).collect();
|
||||||
channels
|
|
||||||
.iter()
|
|
||||||
.for_each(|channel| channels_config.push(channel.to_string()));
|
|
||||||
|
|
||||||
let mode_config: Option<String>;
|
let mode_config: Option<String>;
|
||||||
if mode.is_some() {
|
if mode.is_some() {
|
||||||
|
|
Loading…
Reference in a new issue