Skip to content

Commit b2e745b

Browse files
hatahetalexcrichton
authored andcommitted
---
yaml --- r: 104933 b: refs/heads/snap-stage3 c: c297cff h: refs/heads/master i: 104931: 303c210 v: v3
1 parent 9c4b5df commit b2e745b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
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: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 175bf9470a2f1b95215b4b5dc1f12d949a0f8ddd
4+
refs/heads/snap-stage3: c297cff7771a84c417913b2023353cf44f9e260c
55
refs/heads/try: db814977d07bd798feb24f6b74c00800ef458a13
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libstd/option.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl<T> Option<T> {
149149
}
150150
}
151151

152-
/// Returns the contained value or a default
152+
/// Returns the contained value or a default.
153153
#[inline]
154154
pub fn unwrap_or(self, def: T) -> T {
155155
match self {
@@ -158,7 +158,7 @@ impl<T> Option<T> {
158158
}
159159
}
160160

161-
/// Returns the contained value or computes it from a closure
161+
/// Returns the contained value or computes it from a closure.
162162
#[inline]
163163
pub fn unwrap_or_else(self, f: || -> T) -> T {
164164
match self {
@@ -183,7 +183,7 @@ impl<T> Option<T> {
183183
match self { None => def, Some(t) => f(t) }
184184
}
185185

186-
/// Apply a function to the contained value or do nothing.
186+
/// Applies a function to the contained value or does nothing.
187187
/// Returns true if the contained value was mutated.
188188
pub fn mutate(&mut self, f: |T| -> T) -> bool {
189189
if self.is_some() {
@@ -192,7 +192,7 @@ impl<T> Option<T> {
192192
} else { false }
193193
}
194194

195-
/// Apply a function to the contained value or set it to a default.
195+
/// Applies a function to the contained value or sets it to a default.
196196
/// Returns true if the contained value was mutated, or false if set to the default.
197197
pub fn mutate_or_set(&mut self, def: T, f: |T| -> T) -> bool {
198198
if self.is_some() {
@@ -208,19 +208,19 @@ impl<T> Option<T> {
208208
// Iterator constructors
209209
/////////////////////////////////////////////////////////////////////////
210210

211-
/// Return an iterator over the possibly contained value
211+
/// Returns an iterator over the possibly contained value.
212212
#[inline]
213213
pub fn iter<'r>(&'r self) -> Item<&'r T> {
214214
Item{opt: self.as_ref()}
215215
}
216216

217-
/// Return a mutable iterator over the possibly contained value
217+
/// Returns a mutable iterator over the possibly contained value.
218218
#[inline]
219219
pub fn mut_iter<'r>(&'r mut self) -> Item<&'r mut T> {
220220
Item{opt: self.as_mut()}
221221
}
222222

223-
/// Return a consuming iterator over the possibly contained value
223+
/// Returns a consuming iterator over the possibly contained value.
224224
#[inline]
225225
pub fn move_iter(self) -> Item<T> {
226226
Item{opt: self}
@@ -264,15 +264,15 @@ impl<T> Option<T> {
264264
pub fn or_else(self, f: || -> Option<T>) -> Option<T> {
265265
match self {
266266
Some(_) => self,
267-
None => f(),
267+
None => f()
268268
}
269269
}
270270

271271
/////////////////////////////////////////////////////////////////////////
272272
// Misc
273273
/////////////////////////////////////////////////////////////////////////
274274

275-
/// Take the value out of the option, leaving a `None` in its place.
275+
/// Takes the value out of the option, leaving a `None` in its place.
276276
#[inline]
277277
pub fn take(&mut self) -> Option<T> {
278278
mem::replace(self, None)
@@ -282,7 +282,7 @@ impl<T> Option<T> {
282282
#[inline(always)]
283283
pub fn filtered(self, f: |t: &T| -> bool) -> Option<T> {
284284
match self {
285-
Some(x) => if f(&x) {Some(x)} else {None},
285+
Some(x) => if f(&x) { Some(x) } else { None },
286286
None => None
287287
}
288288
}

0 commit comments

Comments
 (0)