reworked Client list
This commit is contained in:
parent
5823c9ae66
commit
81536fb52c
|
@ -10,4 +10,5 @@ edition = "2018"
|
|||
nix = "0.19.1"
|
||||
x11 = {version = "2.18.2", features = ["xlib"] }
|
||||
log = "0.4.13"
|
||||
weak-table = "0.3.0"
|
||||
simple_logger = "1.11.0"
|
|
@ -1,3 +1,2 @@
|
|||
hard_tabs = true
|
||||
imports_granularity = "Crate"
|
||||
wrap_comments = true
|
11
src/main.rs
11
src/main.rs
|
@ -1,6 +1,8 @@
|
|||
use std::io::Result;
|
||||
use log::info;
|
||||
use std::io::Result;
|
||||
|
||||
//mod state;
|
||||
mod util;
|
||||
mod wm;
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
@ -25,12 +27,11 @@ unsafe extern "C" fn xlib_error_handler(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
fn main() -> Result<()> {
|
||||
simple_logger::SimpleLogger::new().init().unwrap();
|
||||
info!("Hello, World!");
|
||||
simple_logger::SimpleLogger::new().init().unwrap();
|
||||
info!("Hello, World!");
|
||||
|
||||
wm::WMState::init().run();
|
||||
wm::WMState::init().run();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
24
src/util.rs
Normal file
24
src/util.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
use std::hash::{BuildHasherDefault, Hasher};
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
pub struct IdentityHasher(usize);
|
||||
|
||||
impl Hasher for IdentityHasher {
|
||||
fn finish(&self) -> u64 {
|
||||
self.0 as u64
|
||||
}
|
||||
|
||||
fn write(&mut self, _bytes: &[u8]) {
|
||||
unimplemented!("IdentityHasher only supports usize keys")
|
||||
}
|
||||
|
||||
fn write_u64(&mut self, i: u64) {
|
||||
self.0 = i as usize;
|
||||
}
|
||||
|
||||
fn write_usize(&mut self, i: usize) {
|
||||
self.0 = i;
|
||||
}
|
||||
}
|
||||
|
||||
pub type BuildIdentityHasher = BuildHasherDefault<IdentityHasher>;
|
Loading…
Reference in a new issue