Skip to content

docs(course_access): complete save_user_profile docstring with Returns section#239

Open
Divine-designs wants to merge 1 commit into
SkillCert:mainfrom
Divine-designs:feat/issue-206-save-profile-docstring
Open

docs(course_access): complete save_user_profile docstring with Returns section#239
Divine-designs wants to merge 1 commit into
SkillCert:mainfrom
Divine-designs:feat/issue-206-save-profile-docstring

Conversation

@Divine-designs

Copy link
Copy Markdown
Contributor

Summary

Brings the docstring of save_user_profile in contracts/course/course_access/src/functions/save_profile.rs in line with the template requested in #206.

Changes

The existing docstring already had a brief description and # Arguments, but was missing the # Returns section required by the template, and did not call out:

  • the persistent storage write under DataKey::UserProfile(user)
  • the saveUsPrl event emission carrying (user, off_chain_ref_id)
  • the failure mode (empty off_chain_ref_id triggers handle_error(&env, Error::OffChainRefIdRequired))

All three are now documented, and the docstring matches the issue's template:

/// Brief description: explains what the function does.
/// # Arguments
/// * `param1` - …
/// # Returns
/// * `Result<T, E>` / `()` - …

save_user_profile is the only public function in the file, so the issue's scope of "every function on save_profile.rs" is covered.

Verification

cargo build -p course_access  #

Closes #206

…s section

Closes SkillCert#206.

Brings `save_user_profile` docstring in line with the template requested in
the issue: description, Arguments, and Returns. The existing docstring was
missing the `# Returns` section and did not explain the side effects
(persistent storage write + saveUsPrl event emission) or the failure mode
(empty off_chain_ref_id halts execution via handle_error). All three are
now documented.

`save_user_profile` is the only public function in the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Add docstring with description, params, and return

1 participant