Revert "Réglage du formatage des fichiers"
Some checks failed
Rust Checks / checks (push) Failing after 5s
Rust Checks / checks (pull_request) Failing after 17s

This reverts commit 7aff62ecba.
This commit is contained in:
Tipragot 2024-02-04 16:51:56 +01:00
parent 7aff62ecba
commit 44a2c507a3
4 changed files with 24 additions and 27 deletions

View file

@ -1,17 +1,13 @@
use std::collections::HashMap;
use std::io;
use std::net::ToSocketAddrs;
use std::sync::Arc;
use crate::{tcp, Packet};
use bevy::prelude::*;
use std::{collections::HashMap, io, net::ToSocketAddrs, sync::Arc};
#[cfg(feature = "sync")]
use {
use ::{
serde::{de::DeserializeOwned, Serialize},
std::{any::type_name, marker::PhantomData},
};
use crate::{tcp, Packet};
/// A trait for a handler function.
pub trait PacketHandlerFn: Fn(Vec<u8>, &mut World) + Send + Sync + 'static {}

View file

@ -1,8 +1,8 @@
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use serde::de::DeserializeOwned;
use serde::Serialize;
use serde::{de::DeserializeOwned, Serialize};
use std::{
collections::hash_map::DefaultHasher,
hash::{Hash, Hasher},
};
#[cfg(feature = "client")]
pub mod client;

View file

@ -1,17 +1,13 @@
use std::collections::HashMap;
use std::io;
use std::net::ToSocketAddrs;
use std::sync::Arc;
use crate::{tcp, Packet};
use bevy::prelude::*;
use std::{collections::HashMap, io, net::ToSocketAddrs, sync::Arc};
#[cfg(feature = "sync")]
use {
use ::{
serde::{de::DeserializeOwned, Serialize},
std::{any::type_name, marker::PhantomData, ops::Deref},
};
use crate::{tcp, Packet};
/// A trait for a handler function.
pub trait PacketHandlerFn:
Fn(Entity, ClientConnection, Vec<u8>, &mut World) + Send + Sync + 'static

View file

@ -1,11 +1,16 @@
use std::io::{self, Read, Write};
use std::{
io::{self, Read, Write},
net::{Shutdown, TcpStream, ToSocketAddrs},
sync::{
atomic::{AtomicBool, Ordering},
mpsc::{channel, Receiver, Sender},
Arc, Mutex,
},
thread,
};
#[cfg(feature = "server")]
use std::net::TcpListener;
use std::net::{Shutdown, TcpStream, ToSocketAddrs};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::{Arc, Mutex};
use std::thread;
/// A non-blocking TCP connection.
pub struct Connection {