summary refs log tree commit diff
path: root/src/libstd/ffi
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-14 10:56:57 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-14 10:56:57 -0700
commitae7959d298c95d5ffdeae8e7c3f3659d7fc28cdb (patch)
tree575fb3a8174b9103d9976f8f665c75e0922ccb1b /src/libstd/ffi
parent7913f5659d2dd8e8de74d25ad2594b219aa460cc (diff)
parent6fa16d6a473415415cb87a1fe6754aace32cbb1c (diff)
downloadrust-ae7959d298c95d5ffdeae8e7c3f3659d7fc28cdb.tar.gz
rust-ae7959d298c95d5ffdeae8e7c3f3659d7fc28cdb.zip
rollup merge of #24377: apasel422/docs
Conflicts:
	src/libstd/net/ip.rs
	src/libstd/sys/unix/fs.rs
	src/libstd/sys/unix/mod.rs
	src/libstd/sys/windows/mod.rs
Diffstat (limited to 'src/libstd/ffi')
-rw-r--r--src/libstd/ffi/c_str.rs12
-rw-r--r--src/libstd/ffi/mod.rs2
-rw-r--r--src/libstd/ffi/os_str.rs24
3 files changed, 19 insertions, 19 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index 78e21bdd14e..c1c05da4ee4 100644
--- a/src/libstd/ffi/c_str.rs
+++ b/src/libstd/ffi/c_str.rs
@@ -131,7 +131,7 @@ pub struct CStr {
 pub struct NulError(usize, Vec<u8>);
 
 impl CString {
-    /// Create a new C-compatible string from a container of bytes.
+    /// Creates a new C-compatible string from a container of bytes.
     ///
     /// This method will consume the provided data and use the underlying bytes
     /// to construct a new string, ensuring that there is a trailing 0 byte.
@@ -167,7 +167,7 @@ impl CString {
         }
     }
 
-    /// Create a C-compatible string from a byte vector without checking for
+    /// Creates a C-compatible string from a byte vector without checking for
     /// interior 0 bytes.
     ///
     /// This method is equivalent to `new` except that no runtime assertion
@@ -245,7 +245,7 @@ impl From<NulError> for io::Error {
 }
 
 impl CStr {
-    /// Cast a raw C string to a safe C string wrapper.
+    /// Casts a raw C string to a safe C string wrapper.
     ///
     /// This function will cast the provided `ptr` to the `CStr` wrapper which
     /// allows inspection and interoperation of non-owned C strings. This method
@@ -288,7 +288,7 @@ impl CStr {
         mem::transmute(slice::from_raw_parts(ptr, len as usize + 1))
     }
 
-    /// Return the inner pointer to this C string.
+    /// Returns the inner pointer to this C string.
     ///
     /// The returned pointer will be valid for as long as `self` is and points
     /// to a contiguous region of memory terminated with a 0 byte to represent
@@ -298,7 +298,7 @@ impl CStr {
         self.inner.as_ptr()
     }
 
-    /// Convert this C string to a byte slice.
+    /// Converts this C string to a byte slice.
     ///
     /// This function will calculate the length of this string (which normally
     /// requires a linear amount of work to be done) and then return the
@@ -316,7 +316,7 @@ impl CStr {
         &bytes[..bytes.len() - 1]
     }
 
-    /// Convert this C string to a byte slice containing the trailing 0 byte.
+    /// Converts this C string to a byte slice containing the trailing 0 byte.
     ///
     /// This function is the equivalent of `to_bytes` except that it will retain
     /// the trailing nul instead of chopping it off.
diff --git a/src/libstd/ffi/mod.rs b/src/libstd/ffi/mod.rs
index 1b7e913d46c..99becb67a5a 100644
--- a/src/libstd/ffi/mod.rs
+++ b/src/libstd/ffi/mod.rs
@@ -25,6 +25,6 @@ mod os_str;
 /// Freely convertible to an `&OsStr` slice.
 #[unstable(feature = "std_misc")]
 pub trait AsOsStr {
-    /// Convert to an `&OsStr` slice.
+    /// Converts to an `&OsStr` slice.
     fn as_os_str(&self) -> &OsStr;
 }
diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs
index cc2ba265cd7..08b41915d91 100644
--- a/src/libstd/ffi/os_str.rs
+++ b/src/libstd/ffi/os_str.rs
@@ -68,7 +68,7 @@ impl OsString {
         OsString { inner: Buf::from_string(String::new()) }
     }
 
-    /// Construct an `OsString` from a byte sequence.
+    /// Constructs an `OsString` from a byte sequence.
     ///
     /// # Platform behavior
     ///
@@ -93,13 +93,13 @@ impl OsString {
         from_bytes_inner(bytes.into())
     }
 
-    /// Convert to an `OsStr` slice.
+    /// Converts to an `OsStr` slice.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn as_os_str(&self) -> &OsStr {
         self
     }
 
-    /// Convert the `OsString` into a `String` if it contains valid Unicode data.
+    /// Converts the `OsString` into a `String` if it contains valid Unicode data.
     ///
     /// On failure, ownership of the original `OsString` is returned.
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -107,7 +107,7 @@ impl OsString {
         self.inner.into_string().map_err(|buf| OsString { inner: buf} )
     }
 
-    /// Extend the string with the given `&OsStr` slice.
+    /// Extends the string with the given `&OsStr` slice.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn push<T: AsRef<OsStr>>(&mut self, s: T) {
         self.inner.push_slice(&s.as_ref().inner)
@@ -220,13 +220,13 @@ impl Hash for OsString {
 }
 
 impl OsStr {
-    /// Coerce into an `OsStr` slice.
+    /// Coerces into an `OsStr` slice.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn new<S: AsRef<OsStr> + ?Sized>(s: &S) -> &OsStr {
         s.as_ref()
     }
 
-    /// Coerce directly from a `&str` slice to a `&OsStr` slice.
+    /// Coerces directly from a `&str` slice to a `&OsStr` slice.
     #[stable(feature = "rust1", since = "1.0.0")]
     #[deprecated(since = "1.0.0",
                  reason = "use `OsStr::new` instead")]
@@ -234,7 +234,7 @@ impl OsStr {
         unsafe { mem::transmute(Slice::from_str(s)) }
     }
 
-    /// Yield a `&str` slice if the `OsStr` is valid unicode.
+    /// Yields a `&str` slice if the `OsStr` is valid unicode.
     ///
     /// This conversion may entail doing a check for UTF-8 validity.
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -242,7 +242,7 @@ impl OsStr {
         self.inner.to_str()
     }
 
-    /// Convert an `OsStr` to a `Cow<str>`.
+    /// Converts an `OsStr` to a `Cow<str>`.
     ///
     /// Any non-Unicode sequences are replaced with U+FFFD REPLACEMENT CHARACTER.
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -250,13 +250,13 @@ impl OsStr {
         self.inner.to_string_lossy()
     }
 
-    /// Copy the slice into an owned `OsString`.
+    /// Copies the slice into an owned `OsString`.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn to_os_string(&self) -> OsString {
         OsString { inner: self.inner.to_owned() }
     }
 
-    /// Yield this `OsStr` as a byte slice.
+    /// Yields this `OsStr` as a byte slice.
     ///
     /// # Platform behavior
     ///
@@ -274,7 +274,7 @@ impl OsStr {
         }
     }
 
-    /// Create a `CString` containing this `OsStr` data.
+    /// Creates a `CString` containing this `OsStr` data.
     ///
     /// Fails if the `OsStr` contains interior nulls.
     ///
@@ -286,7 +286,7 @@ impl OsStr {
         self.to_bytes().and_then(|b| CString::new(b).ok())
     }
 
-    /// Get the underlying byte representation.
+    /// Gets the underlying byte representation.
     ///
     /// Note: it is *crucial* that this API is private, to avoid
     /// revealing the internal, platform-specific encodings.