mirror of
https://github.com/icewind1991/clipboard-sync
synced 2026-06-03 18:34:07 +02:00
update dependencies and edition
This commit is contained in:
parent
68566144f0
commit
7a0665eae9
5 changed files with 459 additions and 317 deletions
|
|
@ -1,13 +1,5 @@
|
|||
extern crate clipboard;
|
||||
extern crate env_logger;
|
||||
extern crate serde;
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
extern crate serde_json;
|
||||
extern crate ws;
|
||||
|
||||
use clipboard::{ClipboardContext, ClipboardProvider};
|
||||
use common::ClipboardCommand;
|
||||
use crate::common::ClipboardCommand;
|
||||
use std::{thread, thread::JoinHandle, time};
|
||||
use std::env;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
use serde::{Serialize, Deserialize};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum ClipboardCommand {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,4 @@
|
|||
extern crate mio;
|
||||
extern crate serde;
|
||||
#[macro_use] extern crate serde_derive;
|
||||
extern crate serde_json;
|
||||
extern crate ws;
|
||||
|
||||
use common::ClipboardCommand;
|
||||
use crate::common::ClipboardCommand;
|
||||
use mio::Token;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
|
|
@ -27,7 +21,7 @@ fn handle_command(command: ClipboardCommand, sessions: &mut HashMap<String, Sess
|
|||
|
||||
ClipboardCommand::Set { value, session: session_name } => {
|
||||
match sessions.get_mut(&session_name) {
|
||||
Some(mut session) => {
|
||||
Some(session) => {
|
||||
send_to_session(session, &ClipboardCommand::Set {
|
||||
value,
|
||||
session: session_name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue