Skip to content

Commit

Permalink
aya-log-pbf-macros: ensure WriteToBuf is used
Browse files Browse the repository at this point in the history
Previously any old `write` method could be selected.
  • Loading branch information
tamird committed May 4, 2023
1 parent 490d7d5 commit 4d098ef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions aya-log-ebpf-macros/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,11 @@ pub(crate) fn log(args: LogArgs, level: Option<TokenStream>) -> Result<TokenStre
let record_len = header_len;

if let Ok(record_len) = {
use ::aya_log_ebpf::WriteToBuf;
Ok::<_, ()>(record_len) #( .and_then(|record_len| {
if record_len >= buf.buf.len() {
return Err(());
}
{ #values_iter }.write(&mut buf.buf[record_len..]).map(|len| record_len + len)
aya_log_ebpf::WriteToBuf::write({ #values_iter }, &mut buf.buf[record_len..]).map(|len| record_len + len)
}) )*
} {
unsafe { ::aya_log_ebpf::AYA_LOGS.output(
Expand Down

0 comments on commit 4d098ef

Please sign in to comment.