mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-23 01:20:52 +00:00
Run cargo fmt
This commit is contained in:
parent
4ce2bdf0ba
commit
2f4be7a6cd
3 changed files with 25 additions and 12 deletions
|
@ -6,7 +6,7 @@ use smoltcp::time::Instant;
|
|||
pub struct VirtualTunDevice {
|
||||
capabilities: DeviceCapabilities,
|
||||
inbuf: Vec<Vec<u8>>,
|
||||
outbuf: Vec<Vec<u8>>
|
||||
outbuf: Vec<Vec<u8>>,
|
||||
}
|
||||
|
||||
impl VirtualTunDevice {
|
||||
|
@ -51,7 +51,7 @@ impl Device for VirtualTunDevice {
|
|||
type RxToken<'a> = VirtRxToken;
|
||||
type TxToken<'a> = VirtTxToken<'a>;
|
||||
|
||||
fn receive(&mut self, _timestamp: Instant) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)> {
|
||||
fn receive(&mut self, _timestamp: Instant) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)> {
|
||||
if let Some(buffer) = self.inbuf.pop() {
|
||||
let rx = Self::RxToken { buffer };
|
||||
let tx = VirtTxToken(self);
|
||||
|
@ -60,7 +60,7 @@ impl Device for VirtualTunDevice {
|
|||
None
|
||||
}
|
||||
|
||||
fn transmit(&mut self, _timestamp: Instant) -> Option<Self::TxToken<'_>> {
|
||||
fn transmit(&mut self, _timestamp: Instant) -> Option<Self::TxToken<'_>> {
|
||||
return Some(VirtTxToken(self));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue