Skip to content

Commit

Permalink
cargo clippy --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyTornetta committed Dec 11, 2024
1 parent 313d695 commit ec06121
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions cosmos_client/src/chat/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ fn display_messages(
Name::new("Received chat message"),
text.clone(),
text_style.clone(),
text_layout.clone(),
text_layout,
))
.set_parent(chat_box);

Expand All @@ -254,7 +254,7 @@ fn display_messages(
ChatMessage(CHAT_MSG_ALIVE_SEC),
text,
text_style.clone(),
text_layout.clone(),
text_layout,
))
.set_parent(display_box);
}
Expand Down
2 changes: 1 addition & 1 deletion cosmos_client/src/ui/components/scollable_container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fn on_add_scrollbar(mut commands: Commands, mut q_added_button: Query<(Entity, &

..Default::default()
},
BackgroundColor(scrollbox.styles.scrollbar_color.into()),
BackgroundColor(scrollbox.styles.scrollbar_color),
));
})
.id();
Expand Down
10 changes: 5 additions & 5 deletions cosmos_client/src/ui/components/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fn added_text_input_bundle(

let mut text_ent = None;

let mut cursor_style = t_col.clone();
let mut cursor_style = *t_col;
if focused.0 != Some(entity) {
cursor_style.0 = Color::NONE;
}
Expand All @@ -174,15 +174,15 @@ fn added_text_input_bundle(
..Default::default()
},
t_font.clone(),
t_col.clone(),
*t_col,
Node {
align_self: AlignSelf::Center,
..Default::default()
},
))
.with_children(|p| {
p.spawn((TextSpan::new("|"), t_font.clone(), cursor_style));
p.spawn((TextSpan::new(""), t_font.clone(), t_col.clone()));
p.spawn((TextSpan::new(""), t_font.clone(), *t_col));
})
.id(),
);
Expand Down Expand Up @@ -288,7 +288,7 @@ fn send_key_inputs(
fn show_text_cursor(mut writer: TextUiWriter, focused: Res<Focus>, q_text_inputs: Query<(Entity, &TextEnt)>) {
for (ent, text) in q_text_inputs.iter() {
if focused.0.map(|x| x == ent).unwrap_or(false) {
let col = writer.color(text.0, 0).0.clone();
let col = writer.color(text.0, 0).0;
writer.color(text.0, 1).0 = col;
} else {
writer.color(text.0, 1).0 = Color::NONE;
Expand All @@ -313,7 +313,7 @@ fn flash_cursor(
return;
};

let col = writer.color(text.0, 0).0.clone();
let col = writer.color(text.0, 0).0;

let empty = writer.text(text.0, 1).is_empty();
let mut c = writer.color(text.0, 1);
Expand Down
2 changes: 1 addition & 1 deletion cosmos_client/src/ui/crosshair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn add_crosshair(mut commands: Commands, asset_server: Res<AssetServer>) {
.with_children(|parent| {
parent
.spawn((
ImageNode::new(asset_server.load("cosmos/images/ui/crosshair.png").into()),
ImageNode::new(asset_server.load("cosmos/images/ui/crosshair.png")),
Node {
width: Val::Px(8.0),
height: Val::Px(8.0),
Expand Down
2 changes: 1 addition & 1 deletion cosmos_client/src/ui/hotbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ fn add_hotbar(
let path = image_path(hotbar.selected_slot == slot_num);

let mut slot = parent.spawn((
ImageNode::new(asset_server.load(path).into()),
ImageNode::new(asset_server.load(path)),
Node {
width: Val::Px(64.0),
height: Val::Px(64.0),
Expand Down
2 changes: 1 addition & 1 deletion cosmos_client/src/ui/main_menu/disconnect_screen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn create_disconnect_screen(
));

p.spawn((
BorderColor(cool_blue.into()),
BorderColor(cool_blue),
Node {
border: UiRect::all(Val::Px(2.0)),
width: Val::Px(500.0),
Expand Down
4 changes: 2 additions & 2 deletions cosmos_client/src/ui/main_menu/title_screen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fn create_main_menu(mut commands: Commands, default_font: Res<DefaultFont>, q_ui
));

p.spawn((
BorderColor(cool_blue.into()),
BorderColor(cool_blue),
Node {
border: UiRect::all(Val::Px(2.0)),
width: Val::Px(500.0),
Expand All @@ -159,7 +159,7 @@ fn create_main_menu(mut commands: Commands, default_font: Res<DefaultFont>, q_ui
));

p.spawn((
BorderColor(cool_blue.into()),
BorderColor(cool_blue),
Node {
border: UiRect::all(Val::Px(2.0)),
width: Val::Px(500.0),
Expand Down
4 changes: 2 additions & 2 deletions cosmos_client/src/ui/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ fn create_settings_screen(
})
.with_children(|p| {
p.spawn((
BorderColor(cool_blue.into()),
BorderColor(cool_blue),
Node {
border: UiRect::all(Val::Px(2.0)),
width: Val::Px(500.0),
Expand All @@ -277,7 +277,7 @@ fn create_settings_screen(
));

p.spawn((
BorderColor(cool_blue.into()),
BorderColor(cool_blue),
Node {
border: UiRect::all(Val::Px(2.0)),
width: Val::Px(500.0),
Expand Down
2 changes: 1 addition & 1 deletion cosmos_client/src/window/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub enum CursorFlagsSet {
ApplyCursorFlagsUpdates,
}

fn create_debug(mut commands: Commands) {
fn create_debug(commands: Commands) {
// commands.spawn(PerfUiBundle::default());
}

Expand Down

0 comments on commit ec06121

Please sign in to comment.