diff --git a/crates/tor-linkspec/semver.md b/crates/tor-linkspec/semver.md new file mode 100644 index 000000000..ee6bedbd5 --- /dev/null +++ b/crates/tor-linkspec/semver.md @@ -0,0 +1 @@ +ADDED: Constructor for UnparedLinkSpec diff --git a/crates/tor-linkspec/src/ls.rs b/crates/tor-linkspec/src/ls.rs index 26aadbdc7..2bc592e18 100644 --- a/crates/tor-linkspec/src/ls.rs +++ b/crates/tor-linkspec/src/ls.rs @@ -160,6 +160,16 @@ pub struct UnparsedLinkSpec { body: Vec, } +impl UnparsedLinkSpec { + /// Create a new `UnparsedLinkSpec`. + pub fn new(lstype: u8, body: impl Into>) -> Self { + UnparsedLinkSpec { + lstype, + body: body.into(), + } + } +} + impl Readable for UnparsedLinkSpec { fn take_from(r: &mut Reader<'_>) -> Result { let lstype = r.take_u8()?;