Opened 2 years ago

Last modified 19 months ago

#25628 new enhancement

Document our Rust coding standards for error/failure types

Reported by: isis Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: rust, tor-doc, 034-triage-20180328, 034-removed-20180328
Cc: chelseakomlo Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description (last modified by chelseakomlo)

Every crate which returns Result<T, E>s or Option<T> anywhere in its public interface should have an module containing error types which implement either Display or Debug. See the addition to the protover crate from #24031 for an example.

In the future, when failure is 1.0.0, we should also require ::failure::Fail for making errors easier to work with between crates.

Child Tickets

Change History (6)

comment:1 Changed 2 years ago by nickm

Keywords: 034-triage-20180328 added

comment:2 Changed 2 years ago by nickm

Keywords: 034-removed-20180328 added

Per our triage process, these tickets are pending removal from 0.3.4.

comment:3 Changed 2 years ago by nickm

Milestone: Tor: 0.3.4.x-finalTor: unspecified

These tickets, tagged with 034-removed-*, are no longer in-scope for 0.3.4. We can reconsider any of them, if time permits.

comment:4 in reply to:  description Changed 2 years ago by cypherpunks3

Replying to isis:

(doesn't have the ::failure::Fail impl yet, because the failure crate is about to become 1.0.0 any day now).

Not anymore it's not. See also #26337.

comment:5 Changed 2 years ago by chelseakomlo

Description: modified (diff)

Edited ticket description to note that documenting the requirement of ::failure::Fail for failure types will be a separate task once the failure crate reaches stability. See #26337 for more information.

comment:6 Changed 19 months ago by gaba

Sponsor: Sponsor8-can
Note: See TracTickets for help on using tickets.