chore: remove warnings
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-05-12 14:38:03 +02:00
parent 874045dca8
commit 9cb3296cec
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912
5 changed files with 50 additions and 50 deletions

View File

@ -3,7 +3,7 @@ use std::net::SocketAddr;
use axum::{extract::MatchedPath, http::Request, routing::get, Router}; use axum::{extract::MatchedPath, http::Request, routing::get, Router};
use tower_http::trace::TraceLayer; use tower_http::trace::TraceLayer;
use crate::state::{SharedState, State}; use crate::state::SharedState;
async fn root() -> &'static str { async fn root() -> &'static str {
"Hello, hyperlog!" "Hello, hyperlog!"

View File

@ -1,9 +1,9 @@
use std::{net::SocketAddr, sync::Arc}; use std::net::SocketAddr;
use axum::{extract::MatchedPath, http::Request, routing::get, Router}; use axum::{extract::MatchedPath, http::Request, routing::get, Router};
use tower_http::trace::TraceLayer; use tower_http::trace::TraceLayer;
use crate::state::{SharedState, State}; use crate::state::SharedState;
async fn root() -> &'static str { async fn root() -> &'static str {
"Hello, hyperlog!" "Hello, hyperlog!"

View File

@ -4,6 +4,7 @@ use crate::state::SharedState;
pub struct Querier {} pub struct Querier {}
#[allow(dead_code, unused_variables)]
impl Querier { impl Querier {
pub fn new() -> Self { pub fn new() -> Self {
Self {} Self {}

View File

@ -1,5 +1,6 @@
#![feature(map_try_insert)] #![feature(map_try_insert)]
#![feature(fn_traits)] #![feature(fn_traits)]
#![feature(let_chains)]
use std::io::Stdout; use std::io::Stdout;
@ -109,8 +110,9 @@ async fn update<'a>(
let mut handle_key_event = |maybe_event| -> anyhow::Result<UpdateConclusion> { let mut handle_key_event = |maybe_event| -> anyhow::Result<UpdateConclusion> {
match maybe_event { match maybe_event {
Some(Ok(e)) => { Some(Ok(e)) => {
if let Event::Key(key) = e { if let Event::Key(key) = e
if key.kind == KeyEventKind::Press { && key.kind == KeyEventKind::Press
{
let mut cmd = match &app.mode { let mut cmd = match &app.mode {
app::Mode::View => match key.code { app::Mode::View => match key.code {
KeyCode::Enter => app.update(Msg::Interact)?, KeyCode::Enter => app.update(Msg::Interact)?,
@ -133,9 +135,7 @@ async fn update<'a>(
KeyCode::Enter => app.update(Msg::Edit(EditMsg::InsertNewLine))?, KeyCode::Enter => app.update(Msg::Edit(EditMsg::InsertNewLine))?,
KeyCode::Tab => app.update(Msg::Edit(EditMsg::InsertTab))?, KeyCode::Tab => app.update(Msg::Edit(EditMsg::InsertTab))?,
KeyCode::Delete => app.update(Msg::Edit(EditMsg::DeleteNext))?, KeyCode::Delete => app.update(Msg::Edit(EditMsg::DeleteNext))?,
KeyCode::Char(c) => { KeyCode::Char(c) => app.update(Msg::Edit(EditMsg::InsertChar(c)))?,
app.update(Msg::Edit(EditMsg::InsertChar(c)))?
}
KeyCode::Left => app.update(Msg::Edit(EditMsg::MoveLeft))?, KeyCode::Left => app.update(Msg::Edit(EditMsg::MoveLeft))?,
KeyCode::Right => app.update(Msg::Edit(EditMsg::MoveRight))?, KeyCode::Right => app.update(Msg::Edit(EditMsg::MoveRight))?,
KeyCode::Esc => app.update(Msg::EnterViewMode)?, KeyCode::Esc => app.update(Msg::EnterViewMode)?,
@ -158,7 +158,6 @@ async fn update<'a>(
} }
} }
} }
}
Some(Err(e)) => { Some(Err(e)) => {
tracing::warn!("failed to send event: {}", e); tracing::warn!("failed to send event: {}", e);
} }

View File

@ -5,12 +5,12 @@ use hyperlog_protos::hyperlog::{graph_client::GraphClient, graph_item::Contents,
use itertools::Itertools; use itertools::Itertools;
use tonic::transport::Channel; use tonic::transport::Channel;
use crate::shared_engine::SharedEngine; #[allow(dead_code)]
pub struct Querier { pub struct Querier {
channel: Channel, channel: Channel,
} }
#[allow(dead_code, unused_variables)]
impl Querier { impl Querier {
pub async fn new() -> anyhow::Result<Self> { pub async fn new() -> anyhow::Result<Self> {
let channel = Channel::from_static("http://localhost:4000") let channel = Channel::from_static("http://localhost:4000")