diff options
| author | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-08-05 19:55:07 -0700 |
|---|---|---|
| committer | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-08-05 19:55:07 -0700 |
| commit | fb9b27910b41e714dfd6b3ccc48161260943c9cf (patch) | |
| tree | 44ccc3faa8b0565e6f5e56849eb643389d6e0dc3 /src/libstd | |
| parent | c8e454097bf44b1b5b91b46da08dabe9f140a6ee (diff) | |
| download | rust-fb9b27910b41e714dfd6b3ccc48161260943c9cf.tar.gz rust-fb9b27910b41e714dfd6b3ccc48161260943c9cf.zip | |
std: c_str should use regions on methods
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/c_str.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/c_str.rs b/src/libstd/c_str.rs index 312cfe54603..6c5853019b0 100644 --- a/src/libstd/c_str.rs +++ b/src/libstd/c_str.rs @@ -27,7 +27,7 @@ pub struct CString { priv owns_buffer_: bool, } -impl<'self> CString { +impl CString { /// Create a C String from a pointer. pub fn new(buf: *libc::c_char, owns_buffer: bool) -> CString { CString { buf: buf, owns_buffer_: owns_buffer } @@ -80,7 +80,7 @@ impl<'self> CString { /// # Failure /// /// Fails if the CString is null. - pub fn as_bytes(&self) -> &'self [u8] { + pub fn as_bytes<'a>(&'a self) -> &'a [u8] { if self.buf.is_null() { fail!("CString is null!"); } unsafe { let len = libc::strlen(self.buf) as uint; @@ -89,7 +89,7 @@ impl<'self> CString { } /// Return a CString iterator. - fn iter(&self) -> CStringIterator<'self> { + fn iter<'a>(&'a self) -> CStringIterator<'a> { CStringIterator { ptr: self.buf, lifetime: unsafe { cast::transmute(self.buf) }, |
