Skip to content

Commit

Permalink
delete use super import
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki-uchida committed Nov 8, 2024
1 parent 9bb17bd commit 71b8fd5
Show file tree
Hide file tree
Showing 24 changed files with 181 additions and 126 deletions.
19 changes: 10 additions & 9 deletions moqt-core/src/modules/messages/control_messages/announce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ use serde::Serialize;
use std::any::Any;

use crate::{
messages::control_messages::version_specific_parameters::VersionSpecificParameter,
messages::moqt_payload::MOQTPayload,
modules::{
messages::control_messages::version_specific_parameters::VersionSpecificParameter,
variable_integer::read_variable_integer_from_buffer,
},
variable_bytes::{read_variable_bytes_from_buffer, write_variable_bytes},
variable_integer::write_variable_integer,
variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
};

#[derive(Debug, Serialize, Clone, PartialEq)]
Expand Down Expand Up @@ -86,12 +83,16 @@ impl MOQTPayload for Announce {

#[cfg(test)]
mod success {
use crate::messages::control_messages::version_specific_parameters::AuthorizationInfo;
use crate::messages::moqt_payload::MOQTPayload;
use crate::modules::messages::control_messages::announce::Announce;
use crate::modules::messages::control_messages::version_specific_parameters::VersionSpecificParameter;
use bytes::BytesMut;

use crate::messages::{
control_messages::{
announce::Announce,
version_specific_parameters::{AuthorizationInfo, VersionSpecificParameter},
},
moqt_payload::MOQTPayload,
};

#[test]
fn packetize_announce_with_parameter() {
let track_namespace = Vec::from(["test".to_string(), "test".to_string()]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ use std::any::Any;

use crate::{
messages::moqt_payload::MOQTPayload,
modules::{variable_bytes::write_variable_bytes, variable_integer::write_variable_integer},
variable_bytes::read_variable_bytes_from_buffer,
variable_integer::read_variable_integer_from_buffer,
variable_bytes::{read_variable_bytes_from_buffer, write_variable_bytes},
variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
};

#[derive(Debug, Serialize, Clone, PartialEq)]
Expand Down Expand Up @@ -74,11 +73,12 @@ impl MOQTPayload for AnnounceError {

#[cfg(test)]
mod success {
use crate::{
messages::moqt_payload::MOQTPayload,
modules::messages::control_messages::announce_error::AnnounceError,
};
use bytes::BytesMut;

use crate::messages::{
control_messages::announce_error::AnnounceError, moqt_payload::MOQTPayload,
};

#[test]
fn packetize_announce_error() {
let track_namespace = Vec::from(["test".to_string(), "test".to_string()]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use std::any::Any;

use crate::{
messages::moqt_payload::MOQTPayload,
modules::variable_bytes::write_variable_bytes,
variable_bytes::read_variable_bytes_from_buffer,
variable_bytes::{read_variable_bytes_from_buffer, write_variable_bytes},
variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
};

Expand Down Expand Up @@ -54,10 +53,10 @@ impl MOQTPayload for AnnounceOk {

#[cfg(test)]
mod success {
use crate::messages::moqt_payload::MOQTPayload;
use crate::modules::messages::control_messages::announce_ok::AnnounceOk;
use bytes::BytesMut;

use crate::messages::{control_messages::announce_ok::AnnounceOk, moqt_payload::MOQTPayload};

#[test]
fn packetize() {
let track_namespace = Vec::from(["test".to_string(), "test".to_string()]);
Expand Down
16 changes: 10 additions & 6 deletions moqt-core/src/modules/messages/control_messages/client_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{any::Any, vec};

use crate::{
messages::{control_messages::setup_parameters::SetupParameter, moqt_payload::MOQTPayload},
modules::variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
};

#[derive(Debug, Clone, PartialEq)]
Expand Down Expand Up @@ -76,15 +76,19 @@ impl MOQTPayload for ClientSetup {

#[cfg(test)]
mod success {
use bytes::BytesMut;

use crate::{
constants::MOQ_TRANSPORT_VERSION,
messages::moqt_payload::MOQTPayload,
modules::messages::control_messages::{
client_setup::ClientSetup,
setup_parameters::{Role, RoleCase, SetupParameter},
messages::{
control_messages::{
client_setup::ClientSetup,
setup_parameters::{Role, RoleCase, SetupParameter},
},
moqt_payload::MOQTPayload,
},
};
use bytes::BytesMut;

#[test]
fn packetize_client_setup() {
let supported_versions = vec![MOQ_TRANSPORT_VERSION];
Expand Down
16 changes: 10 additions & 6 deletions moqt-core/src/modules/messages/control_messages/server_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::any::Any;

use crate::{
messages::{control_messages::setup_parameters::SetupParameter, moqt_payload::MOQTPayload},
modules::variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
};

#[derive(Debug, Serialize, Clone, PartialEq)]
Expand Down Expand Up @@ -63,15 +63,19 @@ impl MOQTPayload for ServerSetup {

#[cfg(test)]
mod success {
use bytes::BytesMut;

use crate::{
constants::MOQ_TRANSPORT_VERSION,
messages::moqt_payload::MOQTPayload,
modules::messages::control_messages::{
server_setup::ServerSetup,
setup_parameters::{Role, RoleCase, SetupParameter},
messages::{
control_messages::{
server_setup::ServerSetup,
setup_parameters::{Role, RoleCase, SetupParameter},
},
moqt_payload::MOQTPayload,
},
};
use bytes::BytesMut;

#[test]
fn packetize_server_setup() {
let selected_version = MOQ_TRANSPORT_VERSION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::any::Any;

use crate::{
messages::moqt_payload::MOQTPayload,
modules::variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
};

#[derive(Debug, Serialize, Clone, PartialEq)]
Expand Down Expand Up @@ -170,12 +170,13 @@ impl MaxSubscribeID {

#[cfg(test)]
mod success {
use crate::messages::moqt_payload::MOQTPayload;
use crate::modules::messages::control_messages::setup_parameters::{
MaxSubscribeID, Role, RoleCase, SetupParameter,
};
use bytes::BytesMut;

use crate::messages::{
control_messages::setup_parameters::{MaxSubscribeID, Role, RoleCase, SetupParameter},
moqt_payload::MOQTPayload,
};

#[test]
fn packetize_role() {
let role_parameter = Role::new(RoleCase::Publisher);
Expand Down Expand Up @@ -258,10 +259,13 @@ mod success {

#[cfg(test)]
mod failure {
use crate::messages::moqt_payload::MOQTPayload;
use crate::modules::messages::control_messages::setup_parameters::{Path, SetupParameter};
use bytes::BytesMut;

use crate::messages::{
control_messages::setup_parameters::{Path, SetupParameter},
moqt_payload::MOQTPayload,
};

#[test]
fn depacketize_role_invalid_length() {
let bytes_array = [
Expand Down
31 changes: 19 additions & 12 deletions moqt-core/src/modules/messages/control_messages/subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ use crate::{
control_messages::version_specific_parameters::VersionSpecificParameter,
moqt_payload::MOQTPayload,
},
modules::{
variable_bytes::{read_fixed_length_bytes_from_buffer, read_variable_bytes_from_buffer},
variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
variable_bytes::{
read_fixed_length_bytes_from_buffer, read_variable_bytes_from_buffer, write_variable_bytes,
},
variable_bytes::write_variable_bytes,
variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
};

#[derive(Debug, Serialize, Clone, PartialEq, Eq, TryFromPrimitive, IntoPrimitive, Copy)]
Expand Down Expand Up @@ -302,12 +301,16 @@ impl MOQTPayload for Subscribe {

#[cfg(test)]
mod success {
use crate::messages::control_messages::subscribe::{FilterType, GroupOrder, Subscribe};
use crate::messages::control_messages::version_specific_parameters::AuthorizationInfo;
use crate::messages::control_messages::version_specific_parameters::VersionSpecificParameter;
use crate::messages::moqt_payload::MOQTPayload;
use bytes::BytesMut;

use crate::messages::{
control_messages::{
subscribe::{FilterType, GroupOrder, Subscribe},
version_specific_parameters::{AuthorizationInfo, VersionSpecificParameter},
},
moqt_payload::MOQTPayload,
};

#[test]
fn packetize_subscribe_latest_group() {
let subscribe_id = 0;
Expand Down Expand Up @@ -671,12 +674,16 @@ mod success {

#[cfg(test)]
mod failure {
use crate::messages::control_messages::subscribe::{FilterType, GroupOrder, Subscribe};
use crate::messages::control_messages::version_specific_parameters::AuthorizationInfo;
use crate::messages::control_messages::version_specific_parameters::VersionSpecificParameter;
use crate::messages::moqt_payload::MOQTPayload;
use bytes::BytesMut;

use crate::messages::{
control_messages::{
subscribe::{FilterType, GroupOrder, Subscribe},
version_specific_parameters::{AuthorizationInfo, VersionSpecificParameter},
},
moqt_payload::MOQTPayload,
};

#[test]
fn packetize_subscribe_latest_group_with_start_parameter() {
let subscribe_id = 0;
Expand Down
17 changes: 7 additions & 10 deletions moqt-core/src/modules/messages/control_messages/subscribe_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ use std::any::Any;

use crate::{
messages::moqt_payload::MOQTPayload,
modules::{
variable_bytes::{read_variable_bytes_from_buffer, write_variable_bytes},
variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
},
variable_bytes::{read_variable_bytes_from_buffer, write_variable_bytes},
variable_integer::{read_variable_integer_from_buffer, write_variable_integer},
};

#[derive(Debug, IntoPrimitive, TryFromPrimitive, Serialize, Clone, Copy, PartialEq)]
Expand Down Expand Up @@ -101,14 +99,13 @@ impl MOQTPayload for SubscribeError {

#[cfg(test)]
mod success {
use crate::{
messages::moqt_payload::MOQTPayload,
modules::messages::control_messages::subscribe_error::{
SubscribeError, SubscribeErrorCode,
},
};
use bytes::BytesMut;

use crate::messages::{
control_messages::subscribe_error::{SubscribeError, SubscribeErrorCode},
moqt_payload::MOQTPayload,
};

#[test]
fn packetize() {
let subscribe_id = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,16 @@ impl MOQTPayload for SubscribeNamespace {

#[cfg(test)]
mod success {
use crate::messages::control_messages::version_specific_parameters::{
AuthorizationInfo, VersionSpecificParameter,
};
use crate::messages::moqt_payload::MOQTPayload;
use crate::modules::messages::control_messages::subscribe_namespace::SubscribeNamespace;
use bytes::BytesMut;

use crate::messages::{
control_messages::{
subscribe_namespace::SubscribeNamespace,
version_specific_parameters::{AuthorizationInfo, VersionSpecificParameter},
},
moqt_payload::MOQTPayload,
};

#[test]
fn packetize() {
let track_namespace_prefix = Vec::from(["test".to_string(), "test".to_string()]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,13 @@ impl MOQTPayload for SubscribeNamespaceError {

#[cfg(test)]
mod success {
use crate::messages::moqt_payload::MOQTPayload;
use crate::modules::messages::control_messages::subscribe_namespace_error::SubscribeNamespaceError;
use bytes::BytesMut;

use crate::messages::{
control_messages::subscribe_namespace_error::SubscribeNamespaceError,
moqt_payload::MOQTPayload,
};

#[test]
fn packetize() {
let track_namespace_prefix = Vec::from(["test".to_string(), "test".to_string()]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ impl MOQTPayload for SubscribeNamespaceOk {

#[cfg(test)]
mod success {
use crate::messages::moqt_payload::MOQTPayload;
use crate::modules::messages::control_messages::subscribe_namespace_ok::SubscribeNamespaceOk;
use bytes::BytesMut;

use crate::messages::{
control_messages::subscribe_namespace_ok::SubscribeNamespaceOk, moqt_payload::MOQTPayload,
};

#[test]
fn packetize() {
let track_namespace_prefix = Vec::from(["test".to_string(), "test".to_string()]);
Expand Down
22 changes: 10 additions & 12 deletions moqt-core/src/modules/messages/control_messages/subscribe_ok.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,16 @@ impl MOQTPayload for SubscribeOk {

#[cfg(test)]
mod success {
use crate::messages::control_messages::{
subscribe_ok::GroupOrder,
version_specific_parameters::{AuthorizationInfo, VersionSpecificParameter},
};
use crate::{
messages::moqt_payload::MOQTPayload,
modules::messages::control_messages::subscribe_ok::SubscribeOk,
};
use bytes::BytesMut;

use crate::messages::{
control_messages::{
subscribe_ok::{GroupOrder, SubscribeOk},
version_specific_parameters::{AuthorizationInfo, VersionSpecificParameter},
},
moqt_payload::MOQTPayload,
};

#[test]
fn packetize_subscribe_ok_content_not_exists() {
let subscribe_id = 0;
Expand Down Expand Up @@ -331,12 +331,10 @@ mod success {

#[cfg(test)]
mod failure {
use crate::{
messages::moqt_payload::MOQTPayload,
modules::messages::control_messages::subscribe_ok::SubscribeOk,
};
use bytes::BytesMut;

use crate::messages::{control_messages::subscribe_ok::SubscribeOk, moqt_payload::MOQTPayload};

#[test]
fn depacketize_subscribe_ok_invalid_group_order() {
let bytes_array = [
Expand Down
4 changes: 2 additions & 2 deletions moqt-core/src/modules/messages/control_messages/unannounce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ impl MOQTPayload for UnAnnounce {

#[cfg(test)]
mod success {
use crate::messages::control_messages::unannounce::UnAnnounce;
use crate::messages::moqt_payload::MOQTPayload;
use bytes::BytesMut;

use crate::messages::{control_messages::unannounce::UnAnnounce, moqt_payload::MOQTPayload};

#[test]
fn packetize_unannounce() {
let unannounce = UnAnnounce {
Expand Down
Loading

0 comments on commit 71b8fd5

Please sign in to comment.