diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-08-14 20:40:15 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-08-16 16:09:33 -0700 |
| commit | 22c7bbfd0c49330015e24adeb0f2c45ae669c29f (patch) | |
| tree | 44c61eb2f97f4a828c691db400dffdf17765c911 /src/libstd/fmt/parse.rs | |
| parent | 109274426a7cd676b9aa1bb06afd9f86b44f6e9b (diff) | |
| download | rust-22c7bbfd0c49330015e24adeb0f2c45ae669c29f.tar.gz rust-22c7bbfd0c49330015e24adeb0f2c45ae669c29f.zip | |
Delegate `{}` to Default instead of Poly
By using a separate trait this is overridable on a per-type basis and makes room for the possibility of even more arguments passed in for the future.
Diffstat (limited to 'src/libstd/fmt/parse.rs')
| -rw-r--r-- | src/libstd/fmt/parse.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstd/fmt/parse.rs b/src/libstd/fmt/parse.rs index 0d39ae84a60..ef8778abf0e 100644 --- a/src/libstd/fmt/parse.rs +++ b/src/libstd/fmt/parse.rs @@ -339,7 +339,11 @@ impl<'self> Parser<'self> { } } // Finally the actual format specifier - spec.ty = self.word(); + if self.consume('?') { + spec.ty = "?"; + } else { + spec.ty = self.word(); + } return spec; } |
