Fix new lints from rust 1.77 (#1845)
This commit is contained in:
@ -159,9 +159,7 @@ impl Program {
|
|||||||
/// Returns a value that includes the given character position.
|
/// Returns a value that includes the given character position.
|
||||||
/// This is a bit more recursive than `get_body_item_for_position`.
|
/// This is a bit more recursive than `get_body_item_for_position`.
|
||||||
pub fn get_value_for_position(&self, pos: usize) -> Option<&Value> {
|
pub fn get_value_for_position(&self, pos: usize) -> Option<&Value> {
|
||||||
let Some(item) = self.get_body_item_for_position(pos) else {
|
let item = self.get_body_item_for_position(pos)?;
|
||||||
return None;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Recurse over the item.
|
// Recurse over the item.
|
||||||
match item {
|
match item {
|
||||||
@ -177,9 +175,7 @@ impl Program {
|
|||||||
if self.non_code_meta.contains(pos) {
|
if self.non_code_meta.contains(pos) {
|
||||||
return Some(&self.non_code_meta);
|
return Some(&self.non_code_meta);
|
||||||
}
|
}
|
||||||
let Some(item) = self.get_body_item_for_position(pos) else {
|
let item = self.get_body_item_for_position(pos)?;
|
||||||
return None;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Recurse over the item.
|
// Recurse over the item.
|
||||||
let value = match item {
|
let value = match item {
|
||||||
|
@ -77,9 +77,7 @@ impl CopilotCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_cached_result(&self, uri: &String, last_line: u32) -> Option<CopilotCompletionResponse> {
|
pub fn get_cached_result(&self, uri: &String, last_line: u32) -> Option<CopilotCompletionResponse> {
|
||||||
let Some(cached_line) = self.get_last_line(uri) else {
|
let cached_line = self.get_last_line(uri)?;
|
||||||
return None;
|
|
||||||
};
|
|
||||||
if last_line != cached_line {
|
if last_line != cached_line {
|
||||||
return None;
|
return None;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user