Skip to content

Commit 0bea550

Browse files
author
Oliver Schneider
committed
style nitpicks
1 parent dccdde4 commit 0bea550

File tree

6 files changed

+251
-321
lines changed

6 files changed

+251
-321
lines changed

src/libcollections/btree/map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
347347
let result = stack.with(move |pusher, node| {
348348
// Same basic logic as found in `find`, but with PartialSearchStack mediating the
349349
// actual nodes for us
350-
return match Node::search(node, &key) {
350+
match Node::search(node, &key) {
351351
Found(mut handle) => {
352352
// Perfect match, swap the values and return the old one
353353
mem::swap(handle.val_mut(), &mut value);
@@ -372,7 +372,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
372372
}
373373
});
374374
match result {
375-
Finished(ret) => { return ret; },
375+
Finished(ret) => return ret,
376376
Continue((new_stack, renewed_key, renewed_val)) => {
377377
stack = new_stack;
378378
key = renewed_key;
@@ -439,7 +439,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
439439
let mut stack = stack::PartialSearchStack::new(self);
440440
loop {
441441
let result = stack.with(move |pusher, node| {
442-
return match Node::search(node, key) {
442+
match Node::search(node, key) {
443443
Found(handle) => {
444444
// Perfect match. Terminate the stack here, and remove the entry
445445
Finished(Some(pusher.seal(handle).remove()))
@@ -1560,7 +1560,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
15601560
let mut stack = stack::PartialSearchStack::new(self);
15611561
loop {
15621562
let result = stack.with(move |pusher, node| {
1563-
return match Node::search(node, &key) {
1563+
match Node::search(node, &key) {
15641564
Found(handle) => {
15651565
// Perfect match
15661566
Finished(Occupied(OccupiedEntry {

src/librustc/metadata/loader.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -736,12 +736,10 @@ fn get_metadata_section_imp(is_osx: bool, filename: &Path) -> Result<MetadataBlo
736736
}
737737
};
738738
return match ArchiveMetadata::new(archive).map(|ar| MetadataArchive(ar)) {
739-
None => {
740-
return Err((format!("failed to read rlib metadata: '{}'",
741-
filename.display())))
742-
}
743-
Some(blob) => return Ok(blob)
744-
}
739+
None => Err(format!("failed to read rlib metadata: '{}'",
740+
filename.display())),
741+
Some(blob) => Ok(blob)
742+
};
745743
}
746744
unsafe {
747745
let buf = CString::new(filename.as_vec()).unwrap();
@@ -791,7 +789,7 @@ fn get_metadata_section_imp(is_osx: bool, filename: &Path) -> Result<MetadataBlo
791789
}
792790
llvm::LLVMMoveToNextSection(si.llsi);
793791
}
794-
return Err(format!("metadata not found: '{}'", filename.display()));
792+
Err(format!("metadata not found: '{}'", filename.display()))
795793
}
796794
}
797795

0 commit comments

Comments
 (0)