Skip to content

Commit

Permalink
cargo clippy + cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
TicClick committed Feb 17, 2024
1 parent b07df2b commit cf7efb5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
12 changes: 2 additions & 10 deletions crates/steel_core/src/chat/links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,9 @@ impl LinkType {
}

if value.starts_with(PROTOCOL_OSU.as_bytes()) {
if let Some(a) = Action::extract_from_osu(value) {
Some(Self::OSU(a))
} else {
None
}
Action::extract_from_osu(value).map(Self::OSU)
} else if value.starts_with(PROTOCOL_OSUMP.as_bytes()) {
if let Some(a) = Action::extract_from_osump(value) {
Some(Self::OSU(a))
} else {
None
}
Action::extract_from_osump(value).map(Self::OSU)
} else {
None
}
Expand Down
8 changes: 3 additions & 5 deletions crates/steel_core/src/ipc/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ impl ReleaseMetadataGitHub {
}

let mut preferred_architectures = Vec::new();
if cfg!(target_os = "macos") {
if cfg!(target_arch = "aarch64") {
preferred_architectures.push("aarch64-");
}
if cfg!(target_os = "macos") && cfg!(target_arch = "aarch64") {
preferred_architectures.push("aarch64-");
}
if cfg!(target_arch = "x86_64") {
preferred_architectures.push("x86_64-");
Expand All @@ -102,7 +100,7 @@ impl ReleaseMetadataGitHub {
}
}
}
return None;
None
}

pub fn size(&self) -> usize {
Expand Down
6 changes: 3 additions & 3 deletions crates/steel_core/src/settings/colour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ impl From<String> for Colour {
}
}

impl Into<String> for Colour {
fn into(self) -> String {
format!("{} {} {}", self.rgb[0], self.rgb[1], self.rgb[2])
impl From<Colour> for String {
fn from(val: Colour) -> Self {
format!("{} {} {}", val.rgb[0], val.rgb[1], val.rgb[2])
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ fn format_chat_message_text(
};
match link_type {
LinkType::HTTP | LinkType::HTTPS => {
make_regular_link(ui, &display_text, &location);
make_regular_link(ui, &display_text, location);
}
LinkType::OSU(osu_action) => {
match osu_action {
Expand Down

0 comments on commit cf7efb5

Please sign in to comment.