Skip to content

Commit d907b55

Browse files
authored
Use Bevy error in examples (#466)
1 parent 40b2ced commit d907b55

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

bevy_replicon_example_backend/examples/simple_box.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
//! A simple demo to showcase how player could send inputs to move a box and server replicates position back.
22
//! Also demonstrates the single-player and how sever also could be a player.
33
4-
use std::{
5-
hash::{DefaultHasher, Hash, Hasher},
6-
io,
7-
};
4+
use std::hash::{DefaultHasher, Hash, Hasher};
85

96
use bevy::{
107
color::palettes::css::GREEN,
@@ -48,7 +45,7 @@ impl Plugin for SimpleBoxPlugin {
4845
}
4946
}
5047

51-
fn read_cli(mut commands: Commands, cli: Res<Cli>) -> io::Result<()> {
48+
fn read_cli(mut commands: Commands, cli: Res<Cli>) -> Result<()> {
5249
match *cli {
5350
Cli::SinglePlayer => {
5451
info!("starting single-player game");

bevy_replicon_example_backend/examples/tic_tac_toe.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
//! A game to showcase single-player and multiplier game.
22
//! Run it with `cargo run --example tic_tac_toe -- hotseat` to play locally or with `-- client` / `-- server`
33
4-
use std::{
5-
fmt::{self, Formatter},
6-
io,
7-
};
4+
use std::fmt::{self, Formatter};
85

96
use bevy::{platform::collections::HashMap, prelude::*};
107
use bevy_replicon::prelude::*;
@@ -93,7 +90,7 @@ const LINE_THICKNESS: f32 = 10.0;
9390
const BUTTON_SIZE: f32 = CELL_SIZE / 1.2;
9491
const BUTTON_MARGIN: f32 = (CELL_SIZE + LINE_THICKNESS - BUTTON_SIZE) / 2.0;
9592

96-
fn read_cli(mut commands: Commands, cli: Res<Cli>) -> io::Result<()> {
93+
fn read_cli(mut commands: Commands, cli: Res<Cli>) -> Result<()> {
9794
match *cli {
9895
Cli::Hotseat => {
9996
info!("starting hotseat");

0 commit comments

Comments
 (0)