Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify next_fragment and fix obsolete docs #6445

Merged
merged 1 commit into from Jun 22, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Simplify next_fragment and fix obsolete docs

  • Loading branch information
mbrubeck committed Jun 22, 2015
commit a3b339c35896e285e3964fe1c27f1eae4ca63dfd
@@ -301,22 +301,11 @@ impl LineBreaker {
}

/// Acquires a new fragment to lay out from the work list or fragment list as appropriate.
/// If the fragment was at the end of an old line, undoes the line break for that fragment.
/// Note that you probably don't want to call this method directly in order to be incremental-
/// reflow-safe; try `next_unbroken_fragment` instead.
fn next_fragment<I>(&mut self, old_fragment_iter: &mut I) -> Option<Fragment>
where I: Iterator<Item=Fragment> {
let mut fragment;
if self.work_list.is_empty() {
match old_fragment_iter.next() {
None => return None,
Some(this_fragment) => fragment = this_fragment,
}
} else {
return self.work_list.pop_front()
}

Some(fragment)
self.work_list.pop_front().or_else(|| old_fragment_iter.next())
}

/// Acquires a new fragment to lay out from the work list or fragment list, merging it with any
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.