Skip to content

Commit 7a55a3e

Browse files
author
blake2-ppc
committed
---
yaml --- r: 64278 b: refs/heads/snap-stage3 c: c6e7890 h: refs/heads/master v: v3
1 parent df8e946 commit 7a55a3e

File tree

4 files changed

+20
-25
lines changed

4 files changed

+20
-25
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: d2cf2925943b8de3578eaccd00661ceffdd22d7e
4+
refs/heads/snap-stage3: c6e7890e1312412ecf70490b3f00f674fb027f8a
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/etc/vim/ftplugin/rust.vim

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,4 @@ if exists("g:ftplugin_rust_source_path")
3333
let &l:path=g:ftplugin_rust_source_path . ',' . &l:path
3434
endif
3535

36-
if exists("g:loaded_delimitMate")
37-
if exists("b:delimitMate_excluded_regions")
38-
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
39-
endif
40-
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
41-
endif
42-
43-
let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd< | if exists('b:rust_original_delimitMate_excluded_regions') | let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions | unlet b:rust_original_delimitMate_excluded_regions | elseif exists('b:delimitMate_excluded_regions') | unlet b:delimitMate_excluded_regions | endif"
36+
let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<"

branches/snap-stage3/src/etc/vim/syntax/rust.vim

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\(f\|f32\|f64\)\>
113113
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\>"
114114
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>"
115115

116-
" For the benefit of delimitMate
117-
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustLifetime
118-
syn region rustGenericRegion display start=/<\%('\|[^[cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate
119-
syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustLifetime
120-
121116
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
122117
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
123118
syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'"

branches/snap-stage3/src/libextra/dlist.rs

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -300,19 +300,26 @@ impl<T> DList<T> {
300300
self.push_back(elt);
301301
}
302302

303-
/// Merge, using the function `f`; take `a` if `f(a, b)` is true, else `b`.
303+
/// Merge DList `other` into this DList, using the function `f`.
304+
/// Iterate the both DList with `a` from self and `b` from `other`, and
305+
/// put `a` in the result if `f(a, b)` is true, else `b`.
304306
///
305307
/// O(max(N, M))
306308
pub fn merge(&mut self, mut other: DList<T>, f: &fn(&T, &T) -> bool) {
307309
{
308310
let mut it = self.mut_iter();
311+
let mut elt = it.next();
309312
loop {
310-
match (it.next(), other.front()) {
311-
(None , _ ) => break,
312-
(_ , None ) => return,
313-
(Some(x), Some(y)) => if f(x, y) { loop }
313+
let take_a = match (&mut elt, other.front()) {
314+
(_ , None) => return,
315+
(&None, _ ) => break,
316+
(&Some(ref mut x), Some(y)) => f(*x, y),
317+
};
318+
if take_a {
319+
elt = it.next()
320+
} else {
321+
it.insert_before(other.pop_front().unwrap());
314322
}
315-
it.insert_before(other.pop_front().unwrap());
316323
}
317324
}
318325
self.append(other);
@@ -351,11 +358,11 @@ impl<T> DList<T> {
351358
}
352359
}
353360

354-
/// Insert sorted in ascending order
355-
///
356-
/// O(N)
357361
impl<T: cmp::TotalOrd> DList<T> {
358-
fn insert_ordered(&mut self, elt: T) {
362+
/// Insert `elt` sorted in ascending order
363+
///
364+
/// O(N)
365+
pub fn insert_ordered(&mut self, elt: T) {
359366
self.insert_when(elt, |a, b| a.cmp(b) != cmp::Less);
360367
}
361368
}
@@ -758,7 +765,7 @@ mod tests {
758765
assert_eq!(m.len(), len);
759766
check_links(&m);
760767
let res = m.consume_iter().collect::<~[int]>();
761-
assert_eq!(res, ~[-1, 0, 0, 1, 0, 3, 5, 6, 7, 2, 7, 7, 9]);
768+
assert_eq!(res, ~[-1, 0, 0, 0, 1, 3, 5, 6, 7, 2, 7, 7, 9]);
762769
}
763770

764771
#[test]

0 commit comments

Comments
 (0)