Print arrays and maps with to_debug.
This commit is contained in:
@@ -11,6 +11,7 @@ is `T: Display + Debug`):
|
||||
| ----------- | ---------------------------------------------- | ---------------------------- | -------------------------------------------------------------------- |
|
||||
| `to_string` | <code>\|x: &mut T\| -> String</code> | `x.to_string()` | converts the custom type into a [string] |
|
||||
| `print` | <code>\|x: &mut T\| -> String</code> | `x.to_string()` | converts the custom type into a [string] for the [`print`] statement |
|
||||
| `to_debug` | <code>\|x: &mut T\| -> String</code> | `format!("{:?}", x)` | converts the custom type into a [string] in debug format |
|
||||
| `debug` | <code>\|x: &mut T\| -> String</code> | `format!("{:?}", x)` | converts the custom type into a [string] for the [`debug`] statement |
|
||||
| `+` | <code>\|s: &str, x: T\| -> String</code> | `format!("{}{}", s, x)` | concatenates the custom type with another [string] |
|
||||
| `+` | <code>\|x: &mut T, s: &str\| -> String</code> | `x.to_string().push_str(s);` | concatenates another [string] with the custom type |
|
||||
|
Reference in New Issue
Block a user