Skip to content

Commit

Permalink
Tweak wording to recommend, but not require round-tripping
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Dec 19, 2014
1 parent c380963 commit fb4f25c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions text/0000-show-stabilization.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ As described in the motivation section, the intended use cases for the current
`Show` trait are actually motivations for two separate formatting traits. One
trait will be intended for all Rust types to implement in order to easily allow
debugging values for macros such as `assert_eq!` or general `println!`
statements. A separate trait will be intended for Rust types which are "round
trippable" from a string. These types can be represented as a string in a
non-lossy fashion and are intended for general consumption by more than just
developers.
statements. A separate trait will be intended for Rust types which are
faithfully represented as a string. These types can be represented as a string
in a non-lossy fashion and are intended for general consumption by more than
just developers.

This RFC proposes naming these two traits `Show` and `String`, respectively.

Expand All @@ -77,7 +77,8 @@ the default specifier for Rust.

An implementation of the `String` trait is an assertion that the type can be
faithfully represented as a UTF-8 string at all times. If the type can be
reconstructed from a string, then the following relation must be true:
reconstructed from a string, then it is recommended, but not required, that the
following relation be true:

```rust
assert_eq!(foo, from_str(format!("{}", foo).as_slice()).unwrap());
Expand Down

0 comments on commit fb4f25c

Please sign in to comment.