Skip to content

Commit 9c1944d

Browse files
author
Your Name
committed
Fix clippy warnings
1 parent c65bbde commit 9c1944d

File tree

9 files changed

+23
-182
lines changed

9 files changed

+23
-182
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ Parsnip is a single-binary graph database designed to store durable facts as **e
2020
```
2121
┌─────────────────────────────────────────────────────────────┐
2222
│ PROJECT │
23-
│ ┌─────────────┐ ┌─────────────┐ │
24-
│ │ Entity │ works_at │ Entity │ │
25-
│ │ John_Smith │ ──────────────────▶ │ Acme_Corp │ │
26-
│ │ type:person │ │type:company │ │
27-
│ └─────────────┘ └─────────────┘ │
23+
│ ┌─────────────┐ ┌─────────────┐
24+
│ │ Entity │ works_at │ Entity │
25+
│ │ John_Smith │ ──────────────────▶ │ Acme_Corp │
26+
│ │ type:person │ │type:company │
27+
│ └─────────────┘ └─────────────┘
2828
│ │ │
2929
│ │ observations: │
3030
│ │ - "Works on distributed systems" │
31-
│ │ - "Based in Singapore"
31+
│ │ - "Based in earth".
3232
│ │ tags: [engineer, senior] │
3333
└─────────────────────────────────────────────────────────────┘
3434
```

crates/parsnip-cli/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ impl Config {
146146
}
147147

148148
/// Get the effective data directory
149+
#[allow(dead_code)]
149150
pub fn effective_data_dir(&self) -> PathBuf {
150151
self.data_dir.clone().unwrap_or_else(default_data_dir)
151152
}

crates/parsnip-cli/src/output.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Output formatting utilities
22
3+
#![allow(dead_code)]
4+
35
use serde::Serialize;
46

57
/// Output format

crates/parsnip-core/src/query.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,18 @@ pub enum TagMatchMode {
3232
}
3333

3434
/// Project scope for search
35-
#[derive(Debug, Clone, Serialize, Deserialize)]
35+
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3636
#[serde(rename_all = "lowercase")]
3737
pub enum ProjectScope {
3838
/// Search in a single project
3939
Single(ProjectId),
4040
/// Search in multiple specific projects
4141
Multiple(Vec<ProjectId>),
4242
/// Search across all projects
43+
#[default]
4344
All,
4445
}
4546

46-
impl Default for ProjectScope {
47-
fn default() -> Self {
48-
Self::All
49-
}
50-
}
51-
5247
/// Pagination options
5348
#[derive(Debug, Clone, Serialize, Deserialize)]
5449
pub struct Pagination {
@@ -251,7 +246,7 @@ pub struct PaginationInfo {
251246

252247
impl PaginationInfo {
253248
pub fn new(current_page: usize, page_size: usize, total_count: usize) -> Self {
254-
let total_pages = (total_count + page_size - 1) / page_size;
249+
let total_pages = total_count.div_ceil(page_size);
255250
Self {
256251
current_page,
257252
page_size,

crates/parsnip-core/src/traversal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ impl TraversalEngine {
500500
let mut current = end.to_string();
501501
let mut total_weight = 0.0;
502502

503-
while &current != start {
503+
while current != start {
504504
if let Some((prev, edge)) = parent.get(&current) {
505505
total_weight += edge.weight.unwrap_or(1.0);
506506
edges.push(edge.clone());

crates/parsnip-search/src/fulltext.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub struct FullTextSearchEngine {
2020
index: Index,
2121
reader: IndexReader,
2222
writer: RwLock<IndexWriter>,
23+
#[allow(dead_code)]
2324
schema: Schema,
2425
// Fields
2526
entity_id_field: Field,

crates/parsnip-storage/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
//! This crate provides different storage backends for persisting
44
//! the knowledge graph data.
55
6+
#![allow(clippy::result_large_err)]
7+
68
pub mod error;
79
pub mod migration;
810
pub mod traits;

docs/spec.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ parsnip serve --transport stdio
200200
201201
202202
┌─────────────────────────────────────────────────────────────────────────────┐
203-
│ PARSNIP-CORE
203+
│ PARSNIP-CORE │
204204
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
205205
│ │ Graph Engine │ │ Query Planner │ │ Transaction │ │
206206
│ │ • Entities │ │ • Optimization │ │ Manager │ │
@@ -211,7 +211,7 @@ parsnip serve --transport stdio
211211
212212
213213
┌─────────────────────────────────────────────────────────────────────────────┐
214-
│ PARSNIP-SEARCH
214+
│ PARSNIP-SEARCH │
215215
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
216216
│ │ Fuzzy Search │ │ Full-Text │ │ Vector Search │ │
217217
│ │ (nucleo) │ │ (tantivy) │ │ (optional) │ │
@@ -220,7 +220,7 @@ parsnip serve --transport stdio
220220
221221
222222
┌─────────────────────────────────────────────────────────────────────────────┐
223-
│ PARSNIP-STORAGE
223+
│ PARSNIP-STORAGE │
224224
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
225225
│ │ ReDB Backend │ │ SQLite Backend │ │ Remote Backend │ │
226226
│ │ (default) │ │ (compat mode) │ │ (future) │ │
@@ -229,8 +229,8 @@ parsnip serve --transport stdio
229229
230230
231231
┌─────────────────────────────────────────────────────────────────────────────┐
232-
│ FILE SYSTEM
233-
│ ~/.parsnip/
232+
│ FILE SYSTEM │
233+
│ ~/.parsnip/ │
234234
│ ├── data/ # Graph data (ReDB) │
235235
│ │ └── parsnip.db │
236236
│ ├── index/ # Tantivy search index │
@@ -258,7 +258,7 @@ parsnip serve --transport stdio
258258

259259
### Observation (Embedded in Entity)
260260

261-
| Field | Type | Description |
261+
| Field | Type | Description |
262262
|------------|-----------------|------------------------------|
263263
| id | ULID | Unique identifier |
264264
| content | String (FTS) | The observation text |
@@ -281,7 +281,7 @@ parsnip serve --transport stdio
281281

282282
### Project (Namespace)
283283

284-
| Field | Type | Description |
284+
| Field | Type | Description |
285285
|-------------|-----------------|------------------------------|
286286
| id | ULID | Unique identifier |
287287
| name | String (unique) | Project slug (alphanumeric) |

todo.md

Lines changed: 0 additions & 160 deletions
This file was deleted.

0 commit comments

Comments
 (0)