feat(web): Merge configs from all paths
This commit is contained in:
parent
0195939ed8
commit
aa17efd34d
3 changed files with 27 additions and 29 deletions
|
|
@ -8,7 +8,7 @@ use smol::Unblock;
|
|||
use std::io;
|
||||
|
||||
pub async fn main() {
|
||||
let mut app = App::new();
|
||||
let mut app = App::default();
|
||||
|
||||
let mut requests = json_input_stream(async_stdin());
|
||||
|
||||
|
|
@ -33,15 +33,17 @@ pub struct App {
|
|||
out: Unblock<io::Stdout>,
|
||||
}
|
||||
|
||||
impl App {
|
||||
pub fn new() -> Self {
|
||||
impl Default for App {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
config: config::load(),
|
||||
queries: Vec::new(),
|
||||
out: async_stdout(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl App {
|
||||
pub async fn activate(&mut self, id: u32) {
|
||||
if let Some(query) = self.queries.get(id as usize) {
|
||||
eprintln!("got query: {}", query);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue