Skip to content

Commit

Permalink
Make Request impl fns pub(crate)
Browse files Browse the repository at this point in the history
They're only meant to be used internally
  • Loading branch information
DanGould committed Jan 7, 2025
1 parent 1baa8a0 commit a2f8911
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions payjoin/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ pub struct Request {
}

impl Request {
pub fn new_v1(url: Url, body: Vec<u8>) -> Self {
/// Construct a new v1 request.
pub(crate) fn new_v1(url: Url, body: Vec<u8>) -> Self {
Self { url, content_type: V1_REQ_CONTENT_TYPE, body }
}

/// Construct a new v2 request.
#[cfg(feature = "v2")]
pub fn new_v2(url: Url, body: [u8; crate::ohttp::ENCAPSULATED_MESSAGE_BYTES]) -> Self {
pub(crate) fn new_v2(url: Url, body: [u8; crate::ohttp::ENCAPSULATED_MESSAGE_BYTES]) -> Self {
Self { url, content_type: V2_REQ_CONTENT_TYPE, body: body.to_vec() }
}
}

0 comments on commit a2f8911

Please sign in to comment.