Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adhere all documentation to API guidelines strictly #30

Open
maxfierrog opened this issue Apr 25, 2024 · 0 comments
Open

Adhere all documentation to API guidelines strictly #30

maxfierrog opened this issue Apr 25, 2024 · 0 comments
Labels
better engineering Non-essential refactoring, cleaning up code, etc. docs Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed

Comments

@maxfierrog
Copy link
Member

maxfierrog commented Apr 25, 2024

See https://rust-lang.github.io/api-guidelines/documentation.html

In particular, note the importance of the following structure:

/// Quick one-sentence explanation.
///
/// In-depth explanation, possibly spanning multiple paragraphs...
///
/// # Example
///
/// ```no_run
/// let example = something();
/// ...
/// ```
///
/// # Errors
///
/// The exact circumstances under which this errors...
///
/// # Panics
///
/// The exact circumstances under which this panics...
pub fn something(cond: u32) -> Result<()> {
  if cond == 0 {
    panic!()
  } else if cond == 1 {
    Err(anyhow!("Error"))
  } else {
    Ok(())
  }
}

Recommended Courses (UC Berkeley)

This issue just requires the ability to read Rust and write grammatically correct and well-structured English.

  • CS 61B (minimum)
@maxfierrog maxfierrog added better engineering Non-essential refactoring, cleaning up code, etc. good first issue Good for newcomers docs Improvements or additions to documentation help wanted Extra attention is needed and removed better engineering Non-essential refactoring, cleaning up code, etc. docs Improvements or additions to documentation labels Apr 25, 2024
@maxfierrog maxfierrog linked a pull request May 8, 2024 that will close this issue
@maxfierrog maxfierrog removed a link to a pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
better engineering Non-essential refactoring, cleaning up code, etc. docs Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant