refactor: outputdestination.rs -> comm/output_destination.rs

This commit is contained in:
graelo 2021-03-20 22:58:09 +01:00
parent 9426d8bfee
commit 16fa4d45c1
6 changed files with 12 additions and 5 deletions

View file

@ -2,7 +2,12 @@ use clap::Clap;
use std::collections::HashMap; use std::collections::HashMap;
use std::str::FromStr; use std::str::FromStr;
use copyrat::{comm::tmux, error, output_destination::OutputDestination, ui::Selection, CliOpt}; use copyrat::{
comm::{tmux, OutputDestination},
error,
ui::Selection,
CliOpt,
};
/// Main configuration, parsed from command line. /// Main configuration, parsed from command line.
#[derive(Clap, Debug)] #[derive(Clap, Debug)]

View file

@ -1 +1,4 @@
mod output_destination;
pub mod tmux; pub mod tmux;
pub use output_destination::OutputDestination;

View file

@ -1,6 +1,5 @@
pub mod comm; pub mod comm;
pub mod error; pub mod error;
pub mod output_destination;
pub mod textbuf; pub mod textbuf;
pub mod ui; pub mod ui;
@ -40,7 +39,7 @@ pub fn run(buffer: String, opt: &CliOpt) -> Option<ui::Selection> {
}, },
}; };
let default_output_destination = output_destination::OutputDestination::Tmux; let default_output_destination = comm::OutputDestination::Tmux;
let selection: Option<ui::Selection> = { let selection: Option<ui::Selection> = {
let mut ui = ui::ViewController::new( let mut ui = ui::ViewController::new(

View file

@ -1,4 +1,4 @@
use crate::output_destination::OutputDestination; use crate::comm::OutputDestination;
/// Represents the text selected by the user, along with if it was uppercased /// Represents the text selected by the user, along with if it was uppercased
/// and the output destination (Tmux buffer or Clipboard). /// and the output destination (Tmux buffer or Clipboard).

View file

@ -8,7 +8,7 @@ use termion::{self, color, cursor, event, style};
use super::colors::UiColors; use super::colors::UiColors;
use super::Selection; use super::Selection;
use super::{HintAlignment, HintStyle}; use super::{HintAlignment, HintStyle};
use crate::{output_destination::OutputDestination, textbuf}; use crate::{comm::OutputDestination, textbuf};
pub struct ViewController<'a> { pub struct ViewController<'a> {
model: &'a mut textbuf::Model<'a>, model: &'a mut textbuf::Model<'a>,