From 212374ef5c592de4dd976611be34d584eb4a3b4c Mon Sep 17 00:00:00 2001 From: Colin <94314613+ColinWttt@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:58:50 +0800 Subject: [PATCH] Replaces deprecated `#[init(default = ...)]` with `#[init(val = ...)]` (#73) 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