Skip to content

Commit

Permalink
Add missing lifetime annotation to EscapedStr::as_escaped_str (#3920)
Browse files Browse the repository at this point in the history
`JsonTokenIterator` parses and returns `Token`s from a provided u8
slice. `EscapedStr` is used as a member field in several token variants,
such as `ObjectKey` and `ValueString`. While `as_escaped_str` returns a
reference to the underlying `&'a str`, the lifetime annotation was
missing from its return type.

This PR adds the missing lifetime annotation.

Co-authored-by: Fahad Zubair <fahadzub@amazon.com>
  • Loading branch information
drganjoo and Fahad Zubair authored Nov 27, 2024
1 parent 422d9ef commit 104797d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-json/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aws-smithy-json"
version = "0.60.7"
version = "0.61.1"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "John DiSanti <jdisanti@amazon.com>"]
description = "Token streaming JSON parser for smithy-rs."
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-json/src/deserialize/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl<'a> EscapedStr<'a> {
}

/// Returns the escaped string value
pub fn as_escaped_str(&self) -> &str {
pub fn as_escaped_str(&self) -> &'a str {
self.0
}

Expand Down

0 comments on commit 104797d

Please sign in to comment.