Skip to content

Commit 3d04a59

Browse files
lint fixes
1 parent f3d3705 commit 3d04a59

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

crates/pgt_completions/src/context/context.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub(crate) enum NodeUnderCursor<'a> {
5252
},
5353
}
5454

55-
impl<'a> NodeUnderCursor<'a> {
55+
impl NodeUnderCursor<'_> {
5656
pub fn start_byte(&self) -> usize {
5757
match self {
5858
NodeUnderCursor::TsNode(node) => node.start_byte(),
@@ -184,7 +184,7 @@ impl<'a> CompletionContext<'a> {
184184
}
185185

186186
fn gather_policy_context(&mut self) {
187-
let policy_context = PolicyParser::get_context(&self.text, self.position);
187+
let policy_context = PolicyParser::get_context(self.text, self.position);
188188

189189
self.node_under_cursor = Some(NodeUnderCursor::CustomNode {
190190
text: policy_context.node_text.into(),
@@ -658,7 +658,7 @@ mod tests {
658658
match node {
659659
NodeUnderCursor::TsNode(node) => {
660660
assert_eq!(
661-
ctx.get_ts_node_content(&node),
661+
ctx.get_ts_node_content(node),
662662
Some(NodeText::Original("from".into()))
663663
);
664664
}
@@ -688,7 +688,7 @@ mod tests {
688688
match node {
689689
NodeUnderCursor::TsNode(node) => {
690690
assert_eq!(
691-
ctx.get_ts_node_content(&node),
691+
ctx.get_ts_node_content(node),
692692
Some(NodeText::Original("".into()))
693693
);
694694
assert_eq!(ctx.wrapping_clause_type, None);
@@ -721,7 +721,7 @@ mod tests {
721721
match node {
722722
NodeUnderCursor::TsNode(node) => {
723723
assert_eq!(
724-
ctx.get_ts_node_content(&node),
724+
ctx.get_ts_node_content(node),
725725
Some(NodeText::Original("fro".into()))
726726
);
727727
assert_eq!(ctx.wrapping_clause_type, Some(WrappingClause::Select));

crates/pgt_completions/src/context/policy_parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ mod tests {
302302
}
303303
}
304304

305-
return (
305+
(
306306
pos.expect("Please add cursor position!"),
307307
query.replace(CURSOR_POS, "REPLACED_TOKEN").to_string(),
308-
);
308+
)
309309
}
310310

311311
#[test]

crates/pgt_completions/src/providers/policies.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn complete_policies<'a>(ctx: &CompletionContext<'a>, builder: &mut Completi
4545
label: pol.name.chars().take(35).collect::<String>(),
4646
score: CompletionScore::from(relevance.clone()),
4747
filter: CompletionFilter::from(relevance),
48-
description: format!("{}", pol.table_name),
48+
description: pol.table_name.to_string(),
4949
kind: CompletionItemKind::Policy,
5050
completion_text,
5151
};

0 commit comments

Comments
 (0)