[tor-bugs] #25628 [Core Tor/Tor]: Document our Rust coding standards for error/failure types

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Mar 26 18:27:08 UTC 2018


#25628: Document our Rust coding standards for error/failure types
------------------------------+--------------------------------
     Reporter:  isis          |      Owner:  (none)
         Type:  enhancement   |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: 0.3.4.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:  rust, tor-doc
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:  Sponsor8-can  |
------------------------------+--------------------------------
 Every crate which returns `Result<T, E>`s or `Option<T>` anywhere in its
 public interface should have an `errors.rs` module containing error types
 which implement either `Display` or `Debug`, and also `::failure::Fail`
 for making errors easier to work with between crates. See the `errors.rs`
 addition to the `protover` crate from #24031 for an example (doesn't have
 the `::failure::Fail` impl yet, because the failure crate is about to
 become 1.0.0 any day now).

 We should probably wait on this until failure is 1.0.0.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25628>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list