Fixup indentation
This commit is contained in:
+7
-7
@@ -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
@@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user