Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
B-2U committed Aug 14, 2024
1 parent 71cdfd8 commit 36f67d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/dc_utils/autocomplete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub async fn player(ctx: Context<'_>, input: &str) -> Vec<AutocompleteChoice> {
candidates
.into_iter()
.map(|vortex_p| {
let autocomplete_p = vortex_p.to_autocomplete_player(region);
let autocomplete_p = vortex_p.into_autocomplete_player(region);
AutocompleteChoice::new(autocomplete_p.clone(), autocomplete_p.clone())
})
.collect()
Expand Down
12 changes: 6 additions & 6 deletions src/structs/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,15 @@ impl FromStr for AutocompletePlayer {
}
}

impl Into<String> for AutocompletePlayer {
fn into(self) -> String {
format!("{} ({})", self.ign, self.region)
impl From<AutocompletePlayer> for String {
fn from(val: AutocompletePlayer) -> Self {
format!("{} ({})", val.ign, val.region)
}
}

impl Into<Value> for AutocompletePlayer {
fn into(self) -> Value {
Value::String(self.into())
impl From<AutocompletePlayer> for Value {
fn from(val: AutocompletePlayer) -> Self {
Value::String(val.into())
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/wws_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ impl Display for VortexPlayerSearch {

impl VortexPlayerSearch {
/// for turning it into [`AutocompleteChoice`]
pub fn to_autocomplete_player(self, region: Region) -> AutocompletePlayer {
pub fn into_autocomplete_player(self, region: Region) -> AutocompletePlayer {
AutocompletePlayer {
region,
ign: self.name,
Expand Down

0 comments on commit 36f67d9

Please sign in to comment.