fmt: apply rustfmt across slice-2 use-statement drift
This commit is contained in:
@@ -28,7 +28,7 @@ use std::time::{Duration, Instant};
|
||||
use str0m::net::Protocol;
|
||||
use str0m::{Input, Output};
|
||||
|
||||
use crate::rtc_session::{RtcSession, IDLE_TIMEOUT};
|
||||
use crate::rtc_session::{IDLE_TIMEOUT, RtcSession};
|
||||
|
||||
/// 20 ms tick for outbound encoding (matches the PCM frame size, spec §3.9:
|
||||
/// 480 samples @ 24 kHz = 20 ms). On each tick, we pull one frame from the
|
||||
|
||||
@@ -26,8 +26,8 @@ use std::net::SocketAddr;
|
||||
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
use rutster_tap::protocol::{
|
||||
decode_envelope, encode_audio_out, encode_bye, encode_error, encode_hello, DecodedPayload,
|
||||
HelloPayload,
|
||||
DecodedPayload, HelloPayload, decode_envelope, encode_audio_out, encode_bye, encode_error,
|
||||
encode_hello,
|
||||
};
|
||||
use tokio::sync::oneshot;
|
||||
use tokio::task::JoinHandle;
|
||||
@@ -195,8 +195,8 @@ mod tests {
|
||||
// `PcmFrame` is re-exported by `rutster-tap` from `rutster-media` (spec
|
||||
// §3.1 — one canonical home). Test consumes the re-export rather than
|
||||
// adding `rutster-media` as a second path dep on this crate.
|
||||
use rutster_tap::protocol::{encode_audio_in, encode_bye, encode_hello};
|
||||
use rutster_tap::PcmFrame;
|
||||
use rutster_tap::protocol::{encode_audio_in, encode_bye, encode_hello};
|
||||
|
||||
#[tokio::test]
|
||||
async fn echo_round_trips_one_audio_frame() {
|
||||
|
||||
@@ -36,15 +36,15 @@ pub mod tap_client;
|
||||
// future brains) get it from one canonical home (spec §3.1).
|
||||
pub use rutster_media::PcmFrame;
|
||||
|
||||
pub use metrics::{MetricsSnapshot, TapMetrics, TAP_PLAYOUT_FRAMES};
|
||||
pub use metrics::{MetricsSnapshot, TAP_PLAYOUT_FRAMES, TapMetrics};
|
||||
pub use protocol::{
|
||||
decode_envelope, decode_pcm, encode_audio_in, encode_audio_out, encode_bye, encode_error,
|
||||
encode_hello, encode_pcm, encode_session_end, AudioPayload, DecodedFrame, DecodedPayload,
|
||||
Envelope, ErrorPayload, FrameKind, HelloPayload, Payload, ReasonPayload, SessionEndPayload,
|
||||
TapProtoError, PROTOCOL_VERSION, SAMPLES_PER_FRAME as WIRE_SAMPLES_PER_FRAME,
|
||||
AudioPayload, DecodedFrame, DecodedPayload, Envelope, ErrorPayload, FrameKind, HelloPayload,
|
||||
PROTOCOL_VERSION, Payload, ReasonPayload, SAMPLES_PER_FRAME as WIRE_SAMPLES_PER_FRAME,
|
||||
SessionEndPayload, TapProtoError, decode_envelope, decode_pcm, encode_audio_in,
|
||||
encode_audio_out, encode_bye, encode_error, encode_hello, encode_pcm, encode_session_end,
|
||||
};
|
||||
pub use tap_audio_pipe::TapAudioPipe;
|
||||
pub use tap_client::{run_tap_client, TapClientError};
|
||||
pub use tap_client::{TapClientError, run_tap_client};
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
//! cheapest. A snapshot read is taken at log time (e.g. once per second or
|
||||
//! on tap-disconnect).
|
||||
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
|
||||
/// Bounded playout ring capacity (spec §4.1: 5 frames = 100 ms at 20 ms/frame).
|
||||
/// Tunable *constant* (no runtime config in slice-2; a future-rung concern).
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
//! manual `push_back_bounded` policy is the smallest structure that fits.
|
||||
|
||||
use std::collections::VecDeque;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use rutster_media::{AudioSink, AudioSource, PcmFrame};
|
||||
use tokio::sync::mpsc;
|
||||
use tracing::{debug, trace};
|
||||
|
||||
use crate::metrics::{TapMetrics, TAP_PLAYOUT_FRAMES};
|
||||
use crate::metrics::{TAP_PLAYOUT_FRAMES, TapMetrics};
|
||||
|
||||
pub struct TapAudioPipe {
|
||||
// Core → brain (inbound decoded PCM from peer):
|
||||
@@ -226,7 +226,7 @@ mod tests {
|
||||
let (tx_pcm_in, _rx_pcm_in, tx_audio_out, rx_audio_out, metrics) = channels();
|
||||
let mut pipe = TapAudioPipe::new(tx_pcm_in, rx_audio_out, metrics);
|
||||
drop(tx_audio_out); // close the engine→playout-ring direction
|
||||
// Now next_pcm_frame should return None (silence) — Disconnected path.
|
||||
// Now next_pcm_frame should return None (silence) — Disconnected path.
|
||||
assert!(pipe.next_pcm_frame().is_none());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
//! would need a fresh oneshot — breaking the model where the binary holds
|
||||
//! one close signal per session that survives across reconnects.
|
||||
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
@@ -32,14 +32,14 @@ use rutster_call_model::ChannelId;
|
||||
use rutster_media::PcmFrame;
|
||||
use thiserror::Error;
|
||||
use tokio::sync::{mpsc, oneshot};
|
||||
use tokio_tungstenite::tungstenite::Message;
|
||||
use tokio_tungstenite::WebSocketStream;
|
||||
use tokio_tungstenite::tungstenite::Message;
|
||||
use tracing::{debug, info, trace, warn};
|
||||
|
||||
use crate::metrics::TapMetrics;
|
||||
use crate::protocol::{
|
||||
decode_envelope, encode_audio_in, encode_hello, encode_session_end, DecodedPayload,
|
||||
TapProtoError,
|
||||
DecodedPayload, TapProtoError, decode_envelope, encode_audio_in, encode_hello,
|
||||
encode_session_end,
|
||||
};
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//! No authn/authz, no TLS, no multi-tenancy — all deferred per spec §1.2.
|
||||
|
||||
use axum::extract::{Path, State};
|
||||
use axum::http::{header, StatusCode};
|
||||
use axum::http::{StatusCode, header};
|
||||
use axum::response::{IntoResponse, Response};
|
||||
use axum::routing::{get, post};
|
||||
use axum::{Json, Router};
|
||||
|
||||
@@ -38,7 +38,7 @@ use rutster_media::{RtcSession, RtcSessionError};
|
||||
use tokio::sync::Mutex;
|
||||
use tracing::{debug, info, warn};
|
||||
|
||||
use crate::tap_engine::{spawn_tap_engine, TapConn};
|
||||
use crate::tap_engine::{TapConn, spawn_tap_engine};
|
||||
|
||||
/// The per-session wrapper struct (slice-2, spec §6).
|
||||
///
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
//! channel ends the loop_driver touches indirectly through `AudioSource`/
|
||||
//! `AudioSink`).
|
||||
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::time::Duration;
|
||||
|
||||
use futures_util::FutureExt;
|
||||
use rutster_call_model::ChannelId;
|
||||
use rutster_tap::tap_client::{run_tap_client, TapClientError};
|
||||
use rutster_tap::tap_client::{TapClientError, run_tap_client};
|
||||
use rutster_tap::{TapAudioPipe, TapMetrics};
|
||||
use tokio::sync::{mpsc, oneshot};
|
||||
use tokio::task::JoinHandle;
|
||||
@@ -390,7 +390,7 @@ mod tests {
|
||||
assert_eq!(b.next_delay(), Duration::from_secs(1)); // step 3
|
||||
assert_eq!(b.next_delay(), Duration::from_secs(2)); // step 4
|
||||
assert_eq!(b.next_delay(), Duration::from_secs(5)); // step 5: cap
|
||||
// Cap invariant: stays at 5s forever (infinite retries, per spec §5.2).
|
||||
// Cap invariant: stays at 5s forever (infinite retries, per spec §5.2).
|
||||
assert_eq!(b.next_delay(), Duration::from_secs(5)); // step 6
|
||||
assert_eq!(b.next_delay(), Duration::from_secs(5)); // step 7
|
||||
assert_eq!(b.next_delay(), Duration::from_secs(5)); // step 8+
|
||||
|
||||
Reference in New Issue
Block a user