you are viewing a single comment's thread
view the rest of the comments
[–] 12 points 2 years ago (2 children)
let bar: Result<T, E> = ...;
let foo = bar.inspect(|value| log::debug("{}", value));

is equivalent to

let bar: Result<T, E> = ...;
let foo = bar.map(|value| {
    log::debug("{}", value);
    value
});
  • source
  • parent
  • hideshow 4 child comments