Skip to content

Commit

Permalink
Fix warnings about elided lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
hillu committed Dec 21, 2024
1 parent 8c80fe9 commit 386e210
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl Parser {
&'a self,
input: &'a [u8],
ty: MessageType,
) -> IResult<&'a [u8], Vec<(Key, Value)>> {
) -> IResult<&'a [u8], Vec<(Key, Value<'a>)>> {
// Handle some corner cases that don't fit the general key=value
// scheme.
let (input, special) = match ty {
Expand Down Expand Up @@ -167,7 +167,11 @@ impl Parser {

/// Recognize one key/value pair
#[inline(always)]
fn parse_kv<'a>(&'a self, input: &'a [u8], ty: MessageType) -> IResult<&'a [u8], (Key, Value)> {
fn parse_kv<'a>(
&'a self,
input: &'a [u8],
ty: MessageType,
) -> IResult<&'a [u8], (Key, Value<'a>)> {
let (input, key) = match ty {
// Special case for execve arguments: aX, aX[Y], aX_len
MessageType::EXECVE
Expand Down Expand Up @@ -217,7 +221,7 @@ impl Parser {
input: &'a [u8],
ty: MessageType,
c: Common,
) -> IResult<&'a [u8], Value> {
) -> IResult<&'a [u8], Value<'a>> {
let name = <&str>::from(c).as_bytes();
match c {
Common::Arch | Common::CapFi | Common::CapFp | Common::CapFver => {
Expand Down
2 changes: 1 addition & 1 deletion src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ impl From<i64> for Value<'_> {
pub(crate) struct Bytes<'a>(pub &'a [u8]);

#[cfg(feature = "serde")]
impl<'a> Serialize for Bytes<'a> {
impl Serialize for Bytes<'_> {
fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_bytes(self.0)
}
Expand Down

0 comments on commit 386e210

Please sign in to comment.