Skip to content

Commit

Permalink
chore: Clippy and deps fixes for 1.83 (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
timonv authored Dec 1, 2024
1 parent 0797147 commit 5ce4d21
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 172 deletions.
292 changes: 146 additions & 146 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions swiftide-core/src/query_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<'stream, STATE: QueryState + 'stream> Default for QueryStream<'stream, STAT
}
}

impl<'stream, STATE: QueryState> Stream for QueryStream<'stream, STATE> {
impl<STATE: QueryState> Stream for QueryStream<'_, STATE> {
type Item = Result<Query<STATE>>;

fn poll_next(
Expand All @@ -46,8 +46,8 @@ impl<'stream, STATE: QueryState> Stream for QueryStream<'stream, STATE> {
}
}

impl<'stream, STATE: QueryState> From<Pin<Box<dyn Stream<Item = Result<Query<STATE>>> + Send>>>
for QueryStream<'stream, STATE>
impl<STATE: QueryState> From<Pin<Box<dyn Stream<Item = Result<Query<STATE>>> + Send>>>
for QueryStream<'_, STATE>
{
fn from(val: Pin<Box<dyn Stream<Item = Result<Query<STATE>>> + Send>>) -> Self {
QueryStream {
Expand Down
9 changes: 4 additions & 5 deletions swiftide-indexing/src/transformers/metadata_keywords.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
//! Extract keywords from a node and add them as metadata
//! This module defines the `MetadataKeywords` struct and its associated methods,
//! which are used for generating metadata in the form of keywords
//! for a given text. It interacts with a client (e.g., `OpenAI`) to generate
//! the keywords based on the text chunk in a `Node`.
use anyhow::Result;
use async_trait::async_trait;
use swiftide_core::{indexing::Node, Transformer};

/// This module defines the `MetadataKeywords` struct and its associated methods,
/// which are used for generating metadata in the form of keywords
/// for a given text. It interacts with a client (e.g., `OpenAI`) to generate
/// the keywords based on the text chunk in a `Node`.
/// `MetadataKeywords` is responsible for generating keywords
/// for a given text chunk. It uses a templated prompt to interact with a client
/// that implements the `SimplePrompt` trait.
Expand Down
9 changes: 4 additions & 5 deletions swiftide-indexing/src/transformers/metadata_qa_text.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
//! Generates questions and answers from a given text chunk and adds them as metadata.
//! This module defines the `MetadataQAText` struct and its associated methods,
//! which are used for generating metadata in the form of questions and answers
//! from a given text. It interacts with a client (e.g., `OpenAI`) to generate
//! these questions and answers based on the text chunk in an `Node`.
use anyhow::Result;
use async_trait::async_trait;
use swiftide_core::{indexing::Node, Transformer};

/// This module defines the `MetadataQAText` struct and its associated methods,
/// which are used for generating metadata in the form of questions and answers
/// from a given text. It interacts with a client (e.g., `OpenAI`) to generate
/// these questions and answers based on the text chunk in an `Node`.
/// `MetadataQAText` is responsible for generating questions and answers
/// from a given text chunk. It uses a templated prompt to interact with a client
/// that implements the `SimplePrompt` trait.
Expand Down
9 changes: 4 additions & 5 deletions swiftide-indexing/src/transformers/metadata_summary.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
//! Generate a summary and adds it as metadata
//! This module defines the `MetadataSummary` struct and its associated methods,
//! which are used for generating metadata in the form of a summary
//! for a given text. It interacts with a client (e.g., `OpenAI`) to generate
//! the summary based on the text chunk in an `Node`.
use anyhow::Result;
use async_trait::async_trait;
use swiftide_core::{indexing::Node, Transformer};

/// This module defines the `MetadataSummary` struct and its associated methods,
/// which are used for generating metadata in the form of a summary
/// for a given text. It interacts with a client (e.g., `OpenAI`) to generate
/// the summary based on the text chunk in an `Node`.
/// `MetadataSummary` is responsible for generating a summary
/// for a given text chunk. It uses a templated prompt to interact with a client
/// that implements the `SimplePrompt` trait.
Expand Down
10 changes: 4 additions & 6 deletions swiftide-indexing/src/transformers/metadata_title.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
//! Generate a title and adds it as metadata
//! This module defines the `MetadataTitle` struct and its associated methods,
//! which are used for generating metadata in the form of a title
//! for a given text. It interacts with a client (e.g., `OpenAI`) to generate
//! these questions and answers based on the text chunk in an `Node`.
use anyhow::Result;
use async_trait::async_trait;
use swiftide_core::{indexing::Node, Transformer};

/// This module defines the `MetadataTitle` struct and its associated methods,
/// which are used for generating metadata in the form of a title
/// for a given text. It interacts with a client (e.g., `OpenAI`) to generate
/// these questions and answers based on the text chunk in an `Node`.
/// `MetadataTitle` is responsible for generating a title
/// for a given text chunk. It uses a templated prompt to interact with a client
/// that implements the `SimplePrompt` trait.
Expand Down
2 changes: 1 addition & 1 deletion swiftide-integrations/src/aws_bedrock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ pub struct AwsBedrock {
#[builder(setter(into))]
/// The model id or arn of the model to use
model_id: String,
#[builder(default = "self.default_client()", setter(custom))]

#[builder(default = self.default_client(), setter(custom))]
/// The bedrock runtime client
client: Arc<dyn BedrockPrompt>,
#[builder(default)]
Expand Down
2 changes: 1 addition & 1 deletion swiftide-integrations/src/pgvector/fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub(crate) struct PgVectorTestData<'a> {
pub vectors: Vec<(indexing::EmbeddedField, Vec<f32>)>,
}

impl<'a> PgVectorTestData<'a> {
impl PgVectorTestData<'_> {
pub(crate) fn to_node(&self) -> indexing::Node {
// Create the initial builder
let mut base_builder = indexing::Node::builder();
Expand Down

0 comments on commit 5ce4d21

Please sign in to comment.