From 2525d726de229f77793b91f697232b40f8c049cb Mon Sep 17 00:00:00 2001 From: Vitaly Shukela Date: Tue, 21 Feb 2023 19:17:25 +0300 Subject: [PATCH] Fix sample code about OOP Without the change the code fails in Rhai Playground. --- src/language/object-maps-oop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/language/object-maps-oop.md b/src/language/object-maps-oop.md index 0284d094..90f1223c 100644 --- a/src/language/object-maps-oop.md +++ b/src/language/object-maps-oop.md @@ -22,7 +22,7 @@ as a method call on the [object map] itself. ```rust let obj = #{ data: 40, - action: || this.data += x // 'action' holds a closure + action: |x| this.data += x // 'action' holds a closure }; obj.action(2); // calls the function pointer with 'this' bound to 'obj'