Skip to content

Commit 91d7727

Browse files
aochagaviaalexcrichton
authored andcommitted
---
yaml --- r: 126782 b: refs/heads/snap-stage3 c: 6988bcd h: refs/heads/master v: v3
1 parent add17d8 commit 91d7727

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 7be8f0af0393dcdb077c2f6b1653836fd3fba235
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 8836048c76a867f3feee95887d54bd93cc261f41
4+
refs/heads/snap-stage3: 6988bcd74c6ab85d0a5f85c8b96c61f7fb75ad1d
55
refs/heads/try: 502e4c045236682e9728539dc0d2b3d0b237f55c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustrt/c_str.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ use collections::hash;
7373
use core::kinds::marker;
7474
use core::mem;
7575
use core::ptr;
76+
use core::fmt;
7677
use core::raw::Slice;
7778
use core::slice;
7879
use core::str;
@@ -344,6 +345,12 @@ impl Collection for CString {
344345
}
345346
}
346347

348+
impl fmt::Show for CString {
349+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
350+
String::from_utf8_lossy(self.as_bytes_no_nul()).fmt(f)
351+
}
352+
}
353+
347354
/// A generic trait for converting a value to a CString.
348355
pub trait ToCStr {
349356
/// Copy the receiver into a CString.

0 commit comments

Comments
 (0)