-
Notifications
You must be signed in to change notification settings - Fork 102
fix: change handling #167
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
fix: change handling #167
Changes from all commits
001318d
41f3eb8
b7d3cd5
591a81b
bcba5b3
43fd7ca
f9f50cc
24493cf
38f60b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,7 @@ pub fn parse(sql: &str) -> Result<NodeEnum> { | |
.nodes() | ||
.iter() | ||
.find(|n| n.1 == 1) | ||
.unwrap() | ||
.0 | ||
.to_enum() | ||
}) | ||
.map(|n| n.0.to_enum()) | ||
.ok_or_else(|| Error::Parse("Unable to find root node".to_string())) | ||
Comment on lines
+29
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I am not even sure why this is an issue. my assumption was that if pg_query parses something it always has at least one node, but that does not seem to be the case.) |
||
})? | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,7 +149,7 @@ impl Pattern { | |
tokens.push(AnyRecursiveSequence); | ||
} else { | ||
// A pattern is absolute if it starts with a path separator, eg. "/home" or "\\?\C:\Users" | ||
let mut is_absolute = chars.first().map_or(false, |c| path::is_separator(*c)); | ||
let mut is_absolute = chars.first().is_some_and(|c| path::is_separator(*c)); | ||
|
||
// On windows a pattern may also be absolute if it starts with a | ||
// drive letter, a colon and a separator, eg. "c:/Users" or "G:\Users" | ||
|
@@ -368,7 +368,7 @@ impl Pattern { | |
/// `Pattern` using the default match options (i.e. `MatchOptions::new()`). | ||
pub fn matches_path(&self, path: &Path) -> bool { | ||
// FIXME (#9639): This needs to handle non-utf8 paths | ||
path.to_str().map_or(false, |s| self.matches(s)) | ||
path.to_str().is_some_and(|s| self.matches(s)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these changes come from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! I don't know why they weren't already reported in a prev pr though. |
||
} | ||
|
||
/// Return if the given `str` matches this `Pattern` using the specified | ||
|
@@ -381,8 +381,7 @@ impl Pattern { | |
/// `Pattern` using the specified match options. | ||
pub fn matches_path_with(&self, path: &Path, options: MatchOptions) -> bool { | ||
// FIXME (#9639): This needs to handle non-utf8 paths | ||
path.to_str() | ||
.map_or(false, |s| self.matches_with(s, options)) | ||
path.to_str().is_some_and(|s| self.matches_with(s, options)) | ||
} | ||
|
||
/// Access the original glob pattern. | ||
|
@@ -551,7 +550,7 @@ fn chars_eq(a: char, b: char, case_sensitive: bool) -> bool { | |
true | ||
} else if !case_sensitive && a.is_ascii() && b.is_ascii() { | ||
// FIXME: work with non-ascii chars properly (issue #9084) | ||
a.to_ascii_lowercase() == b.to_ascii_lowercase() | ||
a.eq_ignore_ascii_case(&b) | ||
} else { | ||
a == b | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.