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

Ensure that we are complying with Rust API Guidelines #191

Closed
35 of 55 tasks
Tracked by #113
kinggoesgaming opened this issue Mar 30, 2018 · 2 comments
Closed
35 of 55 tasks
Tracked by #113

Ensure that we are complying with Rust API Guidelines #191

kinggoesgaming opened this issue Mar 30, 2018 · 2 comments
Milestone

Comments

@kinggoesgaming
Copy link
Member

kinggoesgaming commented Mar 30, 2018

  • You can visit https://rust-lang-nursery.github.io/api-guidelines/ to get more information on each guideline.
  • If we are not complying with any point, open a separate issue and link the issue as the tracking issue here.
  • If a point is not applicable to uuid put two ~~ around it to cross it out.

  • Naming (crate aligns with Rust naming conventions)
    • Casing conforms to RFC 430 (C-CASE)
    • Ad-hoc conversions follow as_, to_, into_ conventions (C-CONV)
    • Getter names follow Rust convention (C-GETTER)
    • Methods on collections that produce iterators follow iter, iter_mut, into_iter (C-ITER)
      • We do not have any collections
    • Iterator type names match the methods that produce them (C-ITER-TY)
      • We do not have any iterator types.
    • Feature names are free of placeholder words (C-FEATURE)
    • Names use a consistent word order (C-WORD-ORDER)
  • Interoperability (crate interacts nicely with other library functionality)
    • Types eagerly implement common traits (C-COMMON-TRAITS)
      • Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug,
        Display, Default
    • Conversions use the standard traits From, AsRef, AsMut (C-CONV-TRAITS)
    • Collections implement FromIterator and Extend (C-COLLECT)
      • We do not have any collections.
    • Data structures implement Serde's Serialize, Deserialize (C-SERDE)
    • Types are Send and Sync where possible (C-SEND-SYNC)
    • Error types are meaningful and well-behaved (C-GOOD-ERR)
    • Binary number types provide Hex, Octal, Binary formatting (C-NUM-FMT)
      • Uuid and associated adapters dont need Octal and Binary formatting.
    • Generic reader/writer functions take R: Read and W: Write by value (C-RW-VALUE)
      • We do not have reader/writer functions
  • Macros (crate presents well-behaved macros)
    • Input syntax is evocative of the output (C-EVOCATIVE)
      • We do not have any public macros
    • Macros compose well with attributes (C-MACRO-ATTR)
      • We do not have any public macros
    • Item macros work anywhere that items are allowed (C-ANYWHERE)
      • We do not have any public macros
    • Item macros support visibility specifiers (C-MACRO-VIS)
      • We do not have any public macros
    • Type fragments are flexible (C-MACRO-TY)
      • We do not have any public macros
  • Documentation (crate is abundantly documented)
    • Crate level docs are thorough and include examples (C-CRATE-DOC)
    • All items have a rustdoc example (C-EXAMPLE)
    • Examples use ?, not try!, not unwrap (C-QUESTION-MARK)
    • Function docs include error, panic, and safety considerations (C-FAILURE)
    • Prose contains hyperlinks to relevant things (C-LINK)
    • Cargo.toml includes all common metadata (C-METADATA)
      • authors, description, license, homepage, documentation, repository,
        readme, keywords, categories
    • Crate sets html_root_url attribute "https://docs.rs/CRATE/X.Y.Z" (C-HTML-ROOT)
    • Release notes document all significant changes (C-RELNOTES)
    • Rustdoc does not show unhelpful implementation details (C-HIDDEN)
  • Predictability (crate enables legible code that acts how it looks)
    • Smart pointers do not add inherent methods (C-SMART-PTR)
      • We do not have smart pointers
    • Conversions live on the most specific type involved (C-CONV-SPECIFIC)
    • Functions with a clear receiver are methods (C-METHOD)
    • Functions do not take out-parameters (C-NO-OUT)
    • Operator overloads are unsurprising (C-OVERLOAD)
      • We do not have any types with operator overloading
    • Only smart pointers implement Deref and DerefMut (C-DEREF)
      • We do not have smart pointers
    • Constructors are static, inherent methods (C-CTOR)
  • Flexibility (crate supports diverse real-world use cases)
    • Functions expose intermediate results to avoid duplicate work (C-INTERMEDIATE)
    • Caller decides where to copy and place data (C-CALLER-CONTROL)
    • Functions minimize assumptions about parameters by using generics (C-GENERIC)
    • Traits are object-safe if they may be useful as a trait object (C-OBJECT)
  • Type safety (crate leverages the type system effectively)
    • Newtypes provide static distinctions (C-NEWTYPE)
    • Arguments convey meaning through types, not bool or Option (C-CUSTOM-TYPE)
    • Types for a set of flags are bitflags, not enums (C-BITFLAG)
      • We don't have any flags
    • Builders enable construction of complex values (C-BUILDER)
  • Dependability (crate is unlikely to do the wrong thing)
    • Functions validate their arguments (C-VALIDATE)
    • Destructors never fail (C-DTOR-FAIL)
    • Destructors that may block have alternatives (C-DTOR-BLOCK)
      • We don't have destructors that may block
  • Debuggability (crate is conducive to easy debugging)
    • All public types implement Debug (C-DEBUG)
    • Debug representation is never empty (C-DEBUG-NONEMPTY)
  • Future proofing (crate is free to improve without breaking users' code)
    • Sealed traits protect against downstream implementations (C-SEALED)
    • Structs have private fields (C-STRUCT-PRIVATE)
    • Newtypes encapsulate implementation details (C-NEWTYPE-HIDE)
    • Data structures do not duplicate derived trait bounds (C-STRUCT-BOUNDS)
  • Necessities (to whom they matter, they really matter)
    • Public dependencies of a stable crate are stable (C-STABLE)
    • Crate and its dependencies have a permissive license (C-PERMISSIVE)
@KodrAus
Copy link
Member

KodrAus commented Apr 8, 2018

It would be good to run through this when we're ready to release a 1.0 👍

@kinggoesgaming kinggoesgaming modified the milestones: 1.0.0, 0.8.0 Jul 7, 2018
@Dylan-DPC-zz Dylan-DPC-zz modified the milestones: 0.8.0, 1.0.0 Sep 30, 2018
@kinggoesgaming kinggoesgaming pinned this issue Mar 31, 2019
@kinggoesgaming kinggoesgaming modified the milestones: 1.0.0, 0.8.0 Mar 31, 2019
bors bot added a commit that referenced this issue Apr 20, 2019
398: add the categories and keywords r=Dylan-DPC a=kinggoesgaming

**I'm submitting a(n)** other

# Description
Add the categories and keywords in the `Cargo.toml`

# Motivation
Complete Documentation -> C-METADATA requirement

# Tests
N/A

# Related Issue(s)
#191 -> (C-METADATA)


Co-authored-by: Hunar Roop Kahlon <[email protected]>
@kinggoesgaming
Copy link
Member Author

kinggoesgaming commented Oct 22, 2019

@KodrAus @Dylan-DPC We should get these sorted out now...

right now 33 points out of 55 are checked.. lets make it 55

edit: make it 34

@KodrAus KodrAus mentioned this issue Feb 11, 2020
11 tasks
bors bot added a commit that referenced this issue Mar 15, 2020
466: Substitute unwrap for ? operator r=Dylan-DPC a=amadeusine

<!--
    If this PR is a breaking change, ensure that you are opening it against 
    the `breaking` branch.  If the pull request is incomplete, prepend the Title with WIP: 
-->

**I'm submitting a** refactor (and fixes for test cases).

# Description

This PR addresses C-QUESTION-MARK in the roadmap for #191. The examples have been updated to accommodate for the `?` operator instead of `.unwrap` or `try!`.

# Motivation

UUID can move forward with other portions of documentation given this has been completed.

# Tests
<!-- How are these changes tested? -->

All existing tests remain successful after changes.

# Related Issue(s)

#191 


Co-authored-by: Samuel Lim <[email protected]>
bors bot added a commit that referenced this issue Nov 6, 2020
466: Substitute unwrap for ? operator r=KodrAus a=amadeusine

<!--
    If this PR is a breaking change, ensure that you are opening it against 
    the `breaking` branch.  If the pull request is incomplete, prepend the Title with WIP: 
-->

**I'm submitting a** refactor (and fixes for test cases).

# Description

This PR addresses C-QUESTION-MARK in the roadmap for #191. The examples have been updated to accommodate for the `?` operator instead of `.unwrap` or `try!`.

# Motivation

UUID can move forward with other portions of documentation given this has been completed.

# Tests
<!-- How are these changes tested? -->

All existing tests remain successful after changes.

# Related Issue(s)

#191 


Co-authored-by: Samuel Lim <[email protected]>
Co-authored-by: Hunar Roop Kahlon <[email protected]>
Co-authored-by: Samuel Lim <[email protected]>
@KodrAus KodrAus unpinned this issue Aug 16, 2021
@KodrAus KodrAus closed this as completed Oct 28, 2021
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

No branches or pull requests

3 participants