Skip to content

Commit

Permalink
bump: version
Browse files Browse the repository at this point in the history
  • Loading branch information
KunalBagaria committed Dec 12, 2022
1 parent 21d59ed commit 1bed2ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repository = "https://github.com/kb24x7/rustyvibes"
keywords = ["mechanical", "keyboard", "keypress", "keyboard", "sound"]
categories = ["command-line-utilities"]
license = "MIT OR Apache-2.0"
version = "1.0.8"
version = "1.0.9"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
18 changes: 9 additions & 9 deletions src/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ pub mod rustyvibes {
use serde_json::{Map, Value};
use std::error::Error;
use std::fs;

pub use crate::keycode::key_code;
pub use crate::play_sound::sound;

fn initialize_json(path: &str) -> Result<Map<String, Value>, Box<dyn Error>> {
let config = fs::read_to_string(path)?;
let parsed: Value = serde_json::from_str(&config)?;
let obj: Map<String, Value> = parsed.as_object().unwrap().clone();
Ok(obj)
}

pub struct JSONFile {
pub value: Option<serde_json::Map<std::string::String, serde_json::Value>>,
}

impl JSONFile {
pub fn initialize(&mut self, directory: String) {
let soundpack_config = &format!("{}/config.json", directory)[..];
Expand All @@ -36,7 +36,7 @@ pub mod rustyvibes {
}
}
}

pub fn start_rustyvibes(args: String, vol: u16) {
{
#[cfg(any(target_os = "macos", target_os = "linux"))]
Expand Down Expand Up @@ -68,13 +68,13 @@ pub mod rustyvibes {
println!("Error: {:?}", error)
}
}

use once_cell::sync::Lazy;
use std::collections::HashSet;
use std::sync::Mutex;

static KEY_DEPRESSED: Lazy<Mutex<HashSet<i32>>> = Lazy::new(|| Mutex::new(HashSet::new()));

fn callback(event: Event, json_file: serde_json::Map<std::string::String, serde_json::Value>, directory: String, vol: u16) {
match event.event_type {
rdev::EventType::KeyPress(key) => {
Expand Down Expand Up @@ -108,4 +108,4 @@ pub mod rustyvibes {
_ => (),
}
}
}
}

0 comments on commit 1bed2ab

Please sign in to comment.