This repository was archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 657
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for rometools canceled.
|
MichaReiser
commented
Oct 10, 2022
@@ -37,9 +37,6 @@ pub(super) struct StackedStack<'a, T> { | |||
/// The content of the original stack. | |||
original: &'a [T], | |||
|
|||
/// The index of the "top" element in the original stack. | |||
original_top: usize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that having another pointer to point to the "top" of the original stack isn't really necessary, considering that a slice
already has two pointers:
- one pointing to the start
- one pointing to the end (top)
This change updates the slice
inside of pop
to remove the need for an extra original_top
index.
MichaReiser
commented
Oct 10, 2022
Ok(Fits::Maybe) | ||
} | ||
/// Tests if the passed element fits on the current line or not. | ||
fn fits_element(&mut self, element: &'a FormatElement) -> PrintResult<Fits> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only changes to this method are that I had to rewrite state
to self.state
, queue
to self.queue
, ... plus the change in indention level.
81d4ca0
to
512ee1f
Compare
ematipico
approved these changes
Oct 10, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements the fix for #3251 (comment)
This PR addresses an issue in the Printer where fill printed the item in flat mode even though the separator neither fits in flat nor expanded mode. In that case, it is necessary to expand the
item
to avoid overflowing the configured print width.Test Plan
See the updated snapshots.