From e3033d552471d504024d56ff2b9ef634509df262 Mon Sep 17 00:00:00 2001 From: ColinWttt Date: Sun, 2 Feb 2025 16:10:37 +0800 Subject: [PATCH] Replaces deprecated #[init(default = ...)] with #[init(val = ...)] The attribute key #[init(val = ...)] replaces #[init(default = ...)]. More information on https://github.com/godot-rust/gdext/pull/844 --- src/register/constructors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/register/constructors.md b/src/register/constructors.md index fc1657a..cf00365 100644 --- a/src/register/constructors.md +++ b/src/register/constructors.md @@ -44,7 +44,7 @@ struct Monster { } ``` -To provide another default value, use `#[init(default = value)]`. This should only be used for simple cases, as it may lead to difficult-to-read +To provide another default value, use `#[init(val = value)]`. This should only be used for simple cases, as it may lead to difficult-to-read code and error messages. This API may also still change. ```rust @@ -53,7 +53,7 @@ code and error messages. This API may also still change. struct Monster { name: String, // initialized to "" - #[init(default = 100)] + #[init(val = 100)] hitpoints: i32, // initialized to 100 base: Base, // wired up