소스 검색

Merge pull request #975 from sciguy16/feature/ip-v6-new-const

Make Address:v6() constructor const
Dario Nieuwenhuis 7 달 전
부모
커밋
8e3ea5c7f0
1개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 10 1
      src/wire/ip.rs

+ 10 - 1
src/wire/ip.rs

@@ -104,7 +104,16 @@ impl Address {
     /// Create an address wrapping an IPv6 address with the given octets.
     #[cfg(feature = "proto-ipv6")]
     #[allow(clippy::too_many_arguments)]
-    pub fn v6(a0: u16, a1: u16, a2: u16, a3: u16, a4: u16, a5: u16, a6: u16, a7: u16) -> Address {
+    pub const fn v6(
+        a0: u16,
+        a1: u16,
+        a2: u16,
+        a3: u16,
+        a4: u16,
+        a5: u16,
+        a6: u16,
+        a7: u16,
+    ) -> Address {
         Address::Ipv6(Ipv6Address::new(a0, a1, a2, a3, a4, a5, a6, a7))
     }