Compare commits

..

3 Commits

Author SHA1 Message Date
dependabot[bot] f635d80708 build(deps): bump the cargo-crates group across 1 directory with 2 updates
Updates the requirements on [cargo_metadata](https://github.com/oli-obk/cargo_metadata) and [public-api](https://github.com/cargo-public-api/cargo-public-api) to permit the latest version.

Updates `cargo_metadata` to 0.20.0
- [Release notes](https://github.com/oli-obk/cargo_metadata/releases)
- [Changelog](https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oli-obk/cargo_metadata/compare/0.20.0...0.20.0)

Updates `public-api` to 0.48.0
- [Release notes](https://github.com/cargo-public-api/cargo-public-api/releases)
- [Changelog](https://github.com/cargo-public-api/cargo-public-api/blob/main/CHANGELOG.md)
- [Commits](https://github.com/cargo-public-api/cargo-public-api/compare/public-api-v0.48.0...public-api-v0.48.0)

---
updated-dependencies:
- dependency-name: cargo_metadata
  dependency-version: 0.20.0
  dependency-type: direct:production
  dependency-group: cargo-crates
- dependency-name: public-api
  dependency-version: 0.48.0
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
1 week ago
Xiaobo Liu 0b732c3d46 aya-log: simplify map name matching using direct Option comparison
Replace match statement with direct Option comparison for cleaner code

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
1 week ago
Xiaobo Liu cab559b9d9 aya-log: Use `None` instead of wildcard in `Format` impls
The `Format` implementations for various types were using a wildcard `_`
to match the `None` case on `Option<DisplayHint>`.

This is incorrect as it would also match any `Some(...)` variants that
were not explicitly handled, leading to unexpected behavior.

This commit changes the wildcard `_` to an explicit `None` match to
ensure that only the `None` case is handled, making the matching more
explicit and correct.

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
1 week ago

@ -67,7 +67,7 @@ base64 = { version = "0.22.1", default-features = false }
bindgen = { version = "0.72", default-features = false }
bitflags = { version = "2.2.1", default-features = false }
bytes = { version = "1", default-features = false }
cargo_metadata = { version = "0.20.0", default-features = false }
cargo_metadata = { version = "0.21.0", default-features = false }
clap = { version = "4", default-features = false }
const-assert = { version = "1.0.1", default-features = false }
dialoguer = { version = "0.11", default-features = false }
@ -89,7 +89,7 @@ once_cell = { version = "1.20.1", default-features = false }
proc-macro2 = { version = "1", default-features = false }
proc-macro2-diagnostics = { version = "0.10.1", default-features = false }
procfs = { version = "0.17.0", default-features = false }
public-api = { version = "0.48.0", default-features = false }
public-api = { version = "0.49.0", default-features = false }
quote = { version = "1", default-features = false }
rand = { version = "0.9", default-features = false }
rbpf = { version = "0.3.0", default-features = false }

@ -151,10 +151,7 @@ impl<T: Log> EbpfLogger<T> {
.ok_or_else(|| Error::MapNotFound)?
.iter()
.filter_map(|id| MapInfo::from_id(*id).ok())
.find(|map_info| match map_info.name_as_str() {
Some(name) => name == MAP_NAME,
None => false,
})
.find(|map_info| map_info.name_as_str() == Some(MAP_NAME))
.ok_or(Error::MapNotFound)?;
let map = MapData::from_id(map.id())?;
@ -295,7 +292,7 @@ impl Format for u32 {
Some(DisplayHint::Ip) => Ok(Ipv4Formatter::format(*self)),
Some(DisplayHint::LowerMac) => Err(()),
Some(DisplayHint::UpperMac) => Err(()),
_ => Ok(DefaultFormatter::format(self)),
None => Ok(DefaultFormatter::format(self)),
}
}
}
@ -351,7 +348,7 @@ impl Format for [u8; 6] {
Some(DisplayHint::Ip) => Err(()),
Some(DisplayHint::LowerMac) => Ok(LowerMacFormatter::format(*self)),
Some(DisplayHint::UpperMac) => Ok(UpperMacFormatter::format(*self)),
_ => Err(()),
None => Err(()),
}
}
}
@ -365,7 +362,7 @@ impl Format for [u8; 16] {
Some(DisplayHint::Ip) => Ok(Ipv6Formatter::format(*self)),
Some(DisplayHint::LowerMac) => Err(()),
Some(DisplayHint::UpperMac) => Err(()),
_ => Err(()),
None => Err(()),
}
}
}
@ -379,7 +376,7 @@ impl Format for [u16; 8] {
Some(DisplayHint::Ip) => Ok(Ipv6Formatter::format(*self)),
Some(DisplayHint::LowerMac) => Err(()),
Some(DisplayHint::UpperMac) => Err(()),
_ => Err(()),
None => Err(()),
}
}
}
@ -395,7 +392,7 @@ macro_rules! impl_format {
Some(DisplayHint::Ip) => Err(()),
Some(DisplayHint::LowerMac) => Err(()),
Some(DisplayHint::UpperMac) => Err(()),
_ => Ok(DefaultFormatter::format(self)),
None => Ok(DefaultFormatter::format(self)),
}
}
}
@ -424,7 +421,7 @@ macro_rules! impl_format_float {
Some(DisplayHint::Ip) => Err(()),
Some(DisplayHint::LowerMac) => Err(()),
Some(DisplayHint::UpperMac) => Err(()),
_ => Ok(DefaultFormatter::format(self)),
None => Ok(DefaultFormatter::format(self)),
}
}
}

Loading…
Cancel
Save