Skip to content

Fix printing of non-null intrusive pointers #1430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 10, 2021
Merged

Conversation

lava
Copy link
Member

@lava lava commented Mar 10, 2021

📔 Description

n/t

📝 Checklist

  • All user-facing changes have changelog entries.
  • The changes are reflected on docs.tenzir.com/vast, if necessary.
  • The PR description contains instructions for the reviewer, if necessary.

🎯 Review Instructions

@lava lava enabled auto-merge March 10, 2021 12:13
Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor suggestion. Thanks for the fix!

@@ -212,8 +212,8 @@ struct fmt::formatter<caf::intrusive_ptr<T>> {
template <typename FormatContext>
auto format(const caf::intrusive_ptr<T>& item, FormatContext& ctx) {
if (!item)
return format_to(ctx.out(), "*{}", fmt::ptr(item.get()));
return format_to(ctx.out(), "*{}", "nullptr");
return format_to(ctx.out(), "*{}", "nullptr");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return format_to(ctx.out(), "*{}", "nullptr");
return format_to(ctx.out(), "*nullptr");

@@ -227,8 +227,8 @@ struct fmt::formatter<caf::intrusive_cow_ptr<T>> {
template <typename FormatContext>
auto format(const caf::intrusive_cow_ptr<T>& item, FormatContext& ctx) {
if (!item)
return format_to(ctx.out(), "*{}", fmt::ptr(item.get()));
return format_to(ctx.out(), "*{}", "nullptr");
return format_to(ctx.out(), "*{}", "nullptr");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return format_to(ctx.out(), "*{}", "nullptr");
return format_to(ctx.out(), "*nullptr");

@lava lava merged commit 831808f into master Mar 10, 2021
@lava lava deleted the topic/pointer-logging branch March 10, 2021 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants