From bf37cd32f674ef59d3d0c2ede35724e864841ce0 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 25 Mar 2026 22:26:25 +0300 Subject: [PATCH] eventbus: fix example fails to compile (fixes #26763) --- vlib/eventbus/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vlib/eventbus/README.md b/vlib/eventbus/README.md index f3298aff4..822e6d83f 100644 --- a/vlib/eventbus/README.md +++ b/vlib/eventbus/README.md @@ -75,7 +75,7 @@ fn main() { } // the event handler -fn on_error(receiver voidptr, e &Error, work &Work) { +fn on_error(receiver voidptr, e &AnError, work &Work) { println('error occurred on ${work.hours}. Error: ${e.message}') } ``` @@ -87,8 +87,6 @@ module main import eventbus -const eb = eventbus.new[string]() - struct Work { hours int } @@ -119,4 +117,4 @@ fn do_work() { This is mainly for security because if publisher & subscriber are both passed around, a client can easily publish events acting as the server. -So a client should only be able to use the Subscriber methods. \ No newline at end of file +So a client should only be able to use the Subscriber methods. -- 2.39.5