Skip to content

Commit

Permalink
feat(engineio/sid): add as_str fn for Sid (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
Totodore authored Jan 3, 2024
1 parent bdc1bb3 commit c17e28a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engineioxide/src/sid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ impl Sid {
Self::default()
}

fn as_str(&self) -> &str {
/// Get the session id as a base64 10 chars string
pub fn as_str(&self) -> &str {
// SAFETY: SID is always a base64 chars string
unsafe { std::str::from_utf8_unchecked(&self.0) }
}
Expand Down

0 comments on commit c17e28a

Please sign in to comment.