Fixup indentation

This commit is contained in:
bluss
2016-02-06 00:57:30 +01:00
parent 95fb85c241
commit 9fdb7dd631
2 changed files with 8 additions and 8 deletions
+7 -7
View File
@@ -45,7 +45,7 @@ impl<A: Array<Item=u8>> ArrayString<A> {
} }
} }
/// Create a new `ArrayString` from a string slice. /// Create a new `ArrayString` from a `str`.
/// ///
/// Capacity is inferred from the type parameter. /// Capacity is inferred from the type parameter.
/// ///
@@ -54,14 +54,14 @@ impl<A: Array<Item=u8>> ArrayString<A> {
/// ///
/// let mut string = ArrayString::<[_; 3]>::from("foo").unwrap(); /// let mut string = ArrayString::<[_; 3]>::from("foo").unwrap();
/// assert_eq!(&string[..], "foo"); /// assert_eq!(&string[..], "foo");
/// assert_eq!(string.len(), 3); /// assert_eq!(string.len(), 3);
/// assert_eq!(string.capacity(), 3); /// assert_eq!(string.capacity(), 3);
/// ``` /// ```
pub fn from(s: &str) -> Result<Self, CapacityError<&str>> { pub fn from(s: &str) -> Result<Self, CapacityError<&str>> {
let mut arraystr = Self::new(); let mut arraystr = Self::new();
try!(arraystr.push_str(s)); try!(arraystr.push_str(s));
Ok(arraystr) Ok(arraystr)
} }
/// Return the capacity of the `ArrayString`. /// Return the capacity of the `ArrayString`.
/// ///
+1 -1
View File
@@ -298,6 +298,6 @@ fn test_string() {
// Test `from` constructor // Test `from` constructor
let u = ArrayString::<[_; 11]>::from(text).unwrap(); let u = ArrayString::<[_; 11]>::from(text).unwrap();
assert_eq!(&u, text); assert_eq!(&u, text);
assert_eq!(u.len(), text.len()); assert_eq!(u.len(), text.len());
} }