Skip to content

Commit

Permalink
refactor: make cargo clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
azzamsa committed Jul 9, 2024
1 parent d186b8c commit acbe7bf
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@ jobs:
- name: Lint codebase
shell: bash
run: |
just lint
just fmt-check
just comply
2 changes: 1 addition & 1 deletion backend/gdata/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "gdata"
version = "0.0.1"
description = "A graph layer on top of Iroh documents."
license = "MIT OR Apache-2.0"
description = "A graph layer on top of Iroh documents."

edition.workspace = true
repository.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions backend/gdata/gdata_explorer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl App {
.relay_mode(iroh::net::relay::RelayMode::Disabled)
.spawn()
.await?;
let node_author = node.authors.default().await?;
let node_author = node.authors().default().await?;
let graph = IrohGStore::new(node.client().clone(), node_author);

let state = Self::load_home(&node).await?;
Expand All @@ -88,7 +88,7 @@ impl App {

async fn load_home(node: &FsNode) -> anyhow::Result<AppState> {
let mut docs = Vec::new();
let mut stream = node.docs.list().await?;
let mut stream = node.docs().list().await?;
while let Some(doc) = stream.next().await {
let (doc, _cap) = doc?;
docs.push(doc);
Expand Down Expand Up @@ -215,6 +215,7 @@ impl Widget for &mut HomePage {
}
}

#[allow(dead_code)]
struct NamespaceView {
ns: NamespaceId,
history: Vec<GStoreValue<IrohGStore>>,
Expand Down
2 changes: 1 addition & 1 deletion backend/src/bin/gen-namespace-secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ use weird::iroh::docs::NamespaceSecret;

fn main() {
println!("{}", NamespaceSecret::new(&mut rand::thread_rng()));
}
}
8 changes: 6 additions & 2 deletions backend/src/routes/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use axum::{
};
use futures::{pin_mut, StreamExt};
use weird::{
db::StringSerde, iroh::docs::AuthorId, profile::{Profile, Username}
db::StringSerde,
iroh::docs::AuthorId,
profile::{Profile, Username},
};

use crate::ARGS;
Expand All @@ -33,7 +35,9 @@ pub fn install(router: Router<AppState>) -> Router<AppState> {
.route("/profile/:user_id", delete(delete_profile))
}

async fn get_usernames(state: State<AppState>) -> AppResult<Json<HashMap<String, StringSerde<AuthorId>>>> {
async fn get_usernames(
state: State<AppState>,
) -> AppResult<Json<HashMap<String, StringSerde<AuthorId>>>> {
let mut usernames = HashMap::default();
let stream = state.weird.get_usernames().await?;
pin_mut!(stream);
Expand Down
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ dev:

# Format the codebase.
fmt:
cargo fmt --all
pnpm run format
dprint fmt

# Check is the codebase properly formatted.
fmt-check:
cargo fmt --all --check
dprint check

# Lint the codebase.
lint:
cargo clippy --workspace --all-targets --all-features
pnpm run lint
# Run `typos --write-changes` to fix the mistakes
typos

0 comments on commit acbe7bf

Please sign in to comment.