Skip to content

Commit

Permalink
Switch to mod.rs files
Browse files Browse the repository at this point in the history
Having all files related to a module within one directory improves the developer experience.
  • Loading branch information
arctic-alpaca committed Apr 22, 2024
1 parent 514e0a9 commit 5907af6
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 32 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
64 changes: 32 additions & 32 deletions src/ipv6_extensions.rs → src/ipv6_extensions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

let ipv6 =
DataBuffer::<_, Ipv6<NoPreviousHeader>>::parse_ipv6_alone(IPV6_EXT_NO_HOP, 0).unwrap();
Expand All @@ -1039,7 +1039,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

let _ = DataBuffer::<_, Ipv6Extensions<NoPreviousHeader, 10>>::parse_ipv6_extensions_alone(
&IPV6_EXTENSIONS[40..],
Expand Down Expand Up @@ -1093,7 +1093,7 @@ mod tests {
DataBuffer::<_, Ipv6<NoPreviousHeader>>::parse_ipv6_alone(&IPV6_EXTENSIONS, 0).unwrap(),
Ipv6ExtensionType::HopByHop,
)
.unwrap();
.unwrap();

assert!(has_fragment);

Expand All @@ -1102,7 +1102,7 @@ mod tests {
DataBuffer::<_, Ipv6<NoPreviousHeader>>::parse_ipv6_alone(&IPV6_NO_FRAGMENT, 0).unwrap(),
Ipv6ExtensionType::HopByHop,
)
.unwrap();
.unwrap();

assert!(!has_fragment);
}
Expand Down Expand Up @@ -1162,7 +1162,7 @@ mod tests {
ipv6.clone(),
next_header,
)
.unwrap();
.unwrap();
}

#[test]
Expand Down Expand Up @@ -1306,7 +1306,7 @@ mod tests {
ipv6,
Ipv6ExtensionType::Fragment,
)
.unwrap();
.unwrap();
assert!(is_fragment);
assert_eq!(
Ok(Ipv6ExtensionMetadata {
Expand Down Expand Up @@ -1350,7 +1350,7 @@ mod tests {
ipv6,
Ipv6ExtensionType::Fragment,
)
.unwrap();
.unwrap();
assert!(!is_fragment);
assert_eq!(
Ok(Ipv6ExtensionMetadata {
Expand Down Expand Up @@ -1379,7 +1379,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();
assert_eq!(4, exts.ipv6_ext_amount());
}

Expand All @@ -1395,7 +1395,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();
assert_eq!(
[
Some(Ipv6ExtensionType::HopByHop),
Expand All @@ -1420,7 +1420,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Ok(InternetProtocolNumber::Tcp as u8),
Expand All @@ -1440,7 +1440,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Ok(InternetProtocolNumber::Tcp),
Expand All @@ -1460,7 +1460,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Ok(Ipv6ExtensionType::Routing as u8),
Expand Down Expand Up @@ -1492,7 +1492,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Ok(InternetProtocolNumber::Ipv6Routing),
Expand Down Expand Up @@ -1526,7 +1526,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(Ok(0), exts.ipv6_ext_length(0));
assert_eq!(Ok(0), exts.ipv6_ext_length(1));
Expand Down Expand Up @@ -1557,7 +1557,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(Ok(8), exts.ipv6_ext_length_in_bytes(0));
assert_eq!(Ok(8), exts.ipv6_ext_length_in_bytes(1));
Expand Down Expand Up @@ -1585,7 +1585,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(Ok([0xAA; 6].as_slice()), exts.ipv6_ext_data(0));
assert_eq!(Ok([0xBB; 4].as_slice()), exts.ipv6_ext_data(1));
Expand Down Expand Up @@ -1618,7 +1618,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Err(Ipv6ExtFieldError::HeaderFieldDoesNotExist),
Expand Down Expand Up @@ -1660,7 +1660,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Err(Ipv6ExtFieldError::HeaderFieldDoesNotExist),
Expand Down Expand Up @@ -1699,7 +1699,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Err(Ipv6ExtFieldError::HeaderFieldDoesNotExist),
Expand Down Expand Up @@ -1738,7 +1738,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Err(Ipv6ExtFieldError::HeaderFieldDoesNotExist),
Expand Down Expand Up @@ -1777,7 +1777,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Err(Ipv6ExtFieldError::HeaderFieldDoesNotExist),
Expand Down Expand Up @@ -1816,7 +1816,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(&[0xFF; 7], exts.payload());
}
Expand All @@ -1833,7 +1833,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(&[0xFF; 7], exts.payload_mut());
}
Expand All @@ -1850,7 +1850,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(7, exts.payload_length());
}
Expand All @@ -1867,7 +1867,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();
assert_eq!(
Ok(InternetProtocolNumber::Tcp as u8),
exts.ipv6_ext_next_header()
Expand Down Expand Up @@ -1895,7 +1895,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(Ok(0), exts.ipv6_ext_length(0));
assert_eq!(Ok(8), exts.ipv6_ext_length_in_bytes(0));
Expand Down Expand Up @@ -2076,7 +2076,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(Ok([0xAA; 6].as_mut_slice()), exts.ipv6_ext_data_mut(0));
assert_eq!(Ok([0xBB; 4].as_mut_slice()), exts.ipv6_ext_data_mut(1));
Expand Down Expand Up @@ -2108,7 +2108,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Err(Ipv6ExtFieldError::HeaderFieldDoesNotExist),
Expand Down Expand Up @@ -2155,7 +2155,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Err(Ipv6ExtFieldError::HeaderFieldDoesNotExist),
Expand Down Expand Up @@ -2196,7 +2196,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Err(Ipv6ExtFieldError::HeaderFieldDoesNotExist),
Expand Down Expand Up @@ -2237,7 +2237,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Err(Ipv6ExtFieldError::HeaderFieldDoesNotExist),
Expand Down Expand Up @@ -2278,7 +2278,7 @@ mod tests {
ipv6,
next_header,
)
.unwrap();
.unwrap();

assert_eq!(
Err(Ipv6ExtFieldError::HeaderFieldDoesNotExist),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5907af6

Please sign in to comment.