Skip to content

Commit

Permalink
update settings example for v4
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool authored Nov 14, 2024
1 parent d83d62b commit f550db3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mods/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public:
// from its definition in `mod.json`. The signature must match this exactly,
// although the return type should point to a `SettingV3`-derivative rather
// than `std::shared_ptr<SettingV3>` directly
static Result<std::shared_ptr<MyCustomSettingV3>> parse(
static Result<std::shared_ptr<SettingV3>> parse(
// The key of the setting, as defined in `mod.json`
std::string const& key,
// The mod ID this setting is being parsed for
Expand Down Expand Up @@ -456,7 +456,7 @@ public:
root.checkUnknownKeys();

// Return the resulting instance, or an Err if the JSON parsing failed
return root.ok(res);
return root.ok(std::static_pointer_cast<SettingV3>(res));
}

// This is defined at the end of the file, as it needs to know the
Expand Down

0 comments on commit f550db3

Please sign in to comment.