aboutsummaryrefslogtreecommitdiff
path: root/src/packet.rs
diff options
context:
space:
mode:
authorGravatar Alessandro Ghedini <alessandro@ghedini.me> 2020-12-16 13:39:16 +0000
committerGravatar Alessandro Ghedini <alessandro@ghedini.me> 2021-01-21 14:11:19 +0000
commitc4786c06a71cd6b41d9f49d6a055800e19f96a57 (patch)
tree65ce40def20b20bdd274286dbcde9f31d392e640 /src/packet.rs
parent9d0c677ef1411b24d720b5c8b73bcc94b5535c29 (diff)
downloadquiche-c4786c06a71cd6b41d9f49d6a055800e19f96a57.tar.gz
quiche-c4786c06a71cd6b41d9f49d6a055800e19f96a57.tar.zst
quiche-c4786c06a71cd6b41d9f49d6a055800e19f96a57.zip
use ConnectionId in public functions
This changes the remaining public APIs to use the ConnectionId type for connection ID values, instead of slices. The FFI API is left as-is, as there isn't much point to introduce a new type there.
Diffstat (limited to 'src/packet.rs')
-rw-r--r--src/packet.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/packet.rs b/src/packet.rs
index 3906dbb6..83a220af 100644
--- a/src/packet.rs
+++ b/src/packet.rs
@@ -140,13 +140,13 @@ enum ConnectionIdInner<'a> {
impl<'a> ConnectionId<'a> {
/// Creates a new connection ID from the given vector.
#[inline]
- pub fn from_vec(cid: Vec<u8>) -> Self {
+ pub const fn from_vec(cid: Vec<u8>) -> Self {
Self(ConnectionIdInner::Vec(cid))
}
/// Creates a new connection ID from the given slice.
#[inline]
- pub fn from_ref(cid: &'a [u8]) -> Self {
+ pub const fn from_ref(cid: &'a [u8]) -> Self {
Self(ConnectionIdInner::Ref(cid))
}
}