We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
impl Show for &Show
1 parent 566b57f commit 8bdc4b5Copy full SHA for 8bdc4b5
src/libcore/fmt/mod.rs
@@ -518,6 +518,9 @@ impl<'a, T: Show> Show for &'a T {
518
impl<'a, T: Show> Show for &'a mut T {
519
fn fmt(&self, f: &mut Formatter) -> Result { secret_show(&**self, f) }
520
}
521
+impl<'a> Show for &'a Show {
522
+ fn fmt(&self, f: &mut Formatter) -> Result { (*self).fmt(f) }
523
+}
524
525
impl Bool for bool {
526
fn fmt(&self, f: &mut Formatter) -> Result {
src/test/run-pass/ifmt.rs
@@ -81,6 +81,9 @@ pub fn main() {
81
t!(format!("{foo_bar}", foo_bar=1i), "1");
82
t!(format!("{:d}", 5i + 5i), "10");
83
84
+ let a: &fmt::Show = &1i;
85
+ t!(format!("{}", a), "1");
86
+
87
// Formatting strings and their arguments
88
t!(format!("{:s}", "a"), "a");
89
t!(format!("{:4s}", "a"), "a ");
0 commit comments