Don't append a new-line after Indent.#1214
Open
hildebrandmw wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts diskann-benchmark-runner’s Indent formatter so it no longer appends a trailing newline, improving composition when rendering nested/multi-part formatted blocks.
Changes:
- Updated
Indent’sDisplayimplementation to avoid emitting a newline after the final line. - Updated
Indentexamples/tests to match the new no-trailing-newline behavior. - Adjusted CLI output in
app.rsto explicitly print newlines whereIndentpreviously provided them implicitly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| diskann-benchmark-runner/src/utils/fmt.rs | Changes Indent formatting behavior and updates related tests/example. |
| diskann-benchmark-runner/src/app.rs | Updates output formatting to account for Indent no longer ending with a newline. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
196
to
+206
| /// Indents each line of a string by a fixed number of spaces. | ||
| /// | ||
| /// Each line is prefixed with `spaces` spaces and terminated with a newline. | ||
| /// | ||
| /// # Examples | ||
| /// | ||
| /// ``` | ||
| /// use diskann_benchmark_runner::utils::fmt::Indent; | ||
| /// | ||
| /// let indented = Indent::new("hello\nworld", 4).to_string(); | ||
| /// assert_eq!(indented, " hello\n world\n"); | ||
| /// assert_eq!(indented, " hello\n world"); |
Comment on lines
529
to
533
| #[test] | ||
| fn test_indent_multi_line() { | ||
| let s = Indent::new("hello\nworld\nfoo", 2).to_string(); | ||
| assert_eq!(s, " hello\n world\n foo\n"); | ||
| assert_eq!(s, " hello\n world\n foo"); | ||
| } |
JordanMaples
approved these changes
Jun 30, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1214 +/- ##
==========================================
- Coverage 89.82% 89.82% -0.01%
==========================================
Files 489 489
Lines 93575 93579 +4
==========================================
+ Hits 84051 84054 +3
- Misses 9524 9525 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
harsha-simhadri
approved these changes
Jun 30, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently,
Indentis always appending a newline to its last printed line. However, this can make formatting weird when usingIndentto render nested blocks. This PR removes the trailing newline.