Skip to content

Commit

Permalink
Use shorter import in doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexheretic committed Dec 17, 2024
1 parent 81f2b33 commit ef51ddd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Unreleased
- Simplify `Message` to use `Bytes` payload directly with simpler `Utf8Bytes` for text.
- Change `CloseFrame` to use `Utf8Bytes` for `reason`.
- Re-export `Bytes`.

# 0.25.0

Expand Down
7 changes: 2 additions & 5 deletions src/protocol/frame/utf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ impl std::ops::Deref for Utf8Bytes {
type Target = str;

/// ```
/// use tungstenite::protocol::frame::Utf8Bytes;
///
/// /// Example fn that takes a str slice
/// fn a(s: &str) {}
///
/// let data = Utf8Bytes::from_static("foo123");
/// let data = tungstenite::Utf8Bytes::from_static("foo123");
///
/// // auto-deref as arg
/// a(&data);
Expand All @@ -49,8 +47,7 @@ where
for<'a> &'a str: PartialEq<T>,
{
/// ```
/// use tungstenite::protocol::frame::Utf8Bytes;
/// let payload = Utf8Bytes::from_static("foo123");
/// let payload = tungstenite::Utf8Bytes::from_static("foo123");
/// assert_eq!(payload, "foo123");
/// assert_eq!(payload, "foo123".to_string());
/// assert_eq!(payload, &"foo123".to_string());
Expand Down

0 comments on commit ef51ddd

Please sign in to comment.