-
Notifications
You must be signed in to change notification settings - Fork 102
Fix std::fmt::Display for abort expressions
#830
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
Draft
DylanRJohnston
wants to merge
10
commits into
vectordotdev:main
Choose a base branch
from
DylanRJohnston:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d02ee1e
Fixed std::fmt::Display for abort expressions
DylanRJohnston 45428f0
Fix std::fmt::Display for Query
DylanRJohnston 220ef89
Fix std::fmt::Display for Infailable function calls
DylanRJohnston 9206835
Fix float formatting
DylanRJohnston 8aa7d85
Support nested indentation
DylanRJohnston 12356c6
Fix indentation of inline blocks
DylanRJohnston c8e0fb5
Fix formatting of array indexing
DylanRJohnston 89f8ccf
Fix identation within unary negation
DylanRJohnston b4a194b
Re-escape string literals
DylanRJohnston 81eff6e
Merge branch 'vectordotdev:main' into main
DylanRJohnston File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -933,7 +933,7 @@ pub struct Query { | |
|
|
||
| impl fmt::Display for Query { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| write!(f, "{}{}", self.target, self.path) | ||
| write!(f, "{}.{}", self.target, self.path) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -958,7 +958,7 @@ impl fmt::Display for QueryTarget { | |
| match self { | ||
| Internal(v) => v.fmt(f), | ||
| External(prefix) => match prefix { | ||
| PathPrefix::Event => write!(f, "."), | ||
| PathPrefix::Event => write!(f, ""), | ||
|
||
| PathPrefix::Metadata => write!(f, "&"), | ||
| }, | ||
| FunctionCall(v) => v.fmt(f), | ||
|
|
@@ -1002,6 +1002,9 @@ pub struct FunctionCall { | |
| impl fmt::Display for FunctionCall { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| self.ident.fmt(f)?; | ||
| if self.abort_on_error { | ||
| f.write_str("!")?; | ||
| } | ||
| f.write_str("(")?; | ||
|
|
||
| let mut iter = self.arguments.iter().peekable(); | ||
|
|
@@ -1196,7 +1199,7 @@ impl fmt::Display for Abort { | |
| &self | ||
| .message | ||
| .as_ref() | ||
| .map_or_else(|| "abort".to_owned(), |m| format!("abort: {m}")), | ||
| .map_or_else(|| "abort".to_owned(), |m| format!("abort {m}")), | ||
| ) | ||
| } | ||
| } | ||
|
|
||
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.
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.
Without this variable queries end up mushed together e.g.
foo.barbecomesfoobarhowever that then causes.foo.barto become..foo.barwithout the change toQueryTargetbelow.