update to 2018 edition

pull/6/head
dvkt 4 years ago
parent 240e801d2b
commit 084b572b42

@ -3,6 +3,7 @@ name = "phetch"
version = "0.1.1"
authors = ["dvkt <c@dvkt.io>"]
license = "MIT"
edition = "2018"
description = "a terminal gopher client designed to help you quickly navigate the gophersphere"
readme = "README.md"
repository = "https://github.com/dvkt/phetch"

@ -1,4 +1,4 @@
use config;
use crate::config;
use std::io::{Read, Result};
// Bookmarks only work if you've created a ~/.config/phetch/ manually.

@ -1,4 +1,4 @@
use gopher;
use crate::gopher;
use std::fs::{File, OpenOptions};
use std::io::{BufReader, Result, Write};

@ -1,4 +1,3 @@
use gopher;
use std::io::{Read, Result, Write};
use std::net::TcpStream;
use std::net::ToSocketAddrs;

@ -1,5 +1,5 @@
use bookmarks;
use history;
use crate::bookmarks;
use crate::history;
pub fn lookup(name: &str) -> Option<String> {
Some(match name {

@ -1,4 +1,4 @@
use config;
use crate::config;
use std::io::{BufRead, Result};
// History only works if you've created ~/.config/phetch/history.gph manually.

@ -1,7 +1,5 @@
#![allow(unused_must_use)]
extern crate termion;
#[macro_use]
pub mod utils;
pub mod bookmarks;

@ -1,12 +1,11 @@
use crate::gopher;
use crate::gopher::Type;
use crate::ui;
use crate::ui::{Action, Key, View, MAX_COLS, SCROLL_LINES};
use std::fmt;
use std::io::stdout;
use std::io::Write;
use gopher;
use gopher::Type;
use ui;
use ui::{Action, Key, View, MAX_COLS, SCROLL_LINES};
pub struct Menu {
pub url: String, // gopher url
pub lines: Vec<Line>, // lines

@ -1,5 +1,5 @@
use crate::ui::{Action, Key, View, MAX_COLS, SCROLL_LINES};
use std::fmt;
use ui::{Action, Key, View, MAX_COLS, SCROLL_LINES};
pub struct Text {
url: String,

@ -3,6 +3,14 @@ mod view;
pub use self::action::Action;
pub use self::view::View;
use crate::bookmarks;
use crate::gopher;
use crate::gopher::Type;
use crate::help;
use crate::history;
use crate::menu::Menu;
use crate::text::Text;
use crate::utils;
use std::io::{stdin, stdout, Result, Write};
use std::process;
use std::process::Stdio;
@ -14,15 +22,6 @@ use termion::input::TermRead;
use termion::raw::IntoRawMode;
use termion::terminal_size;
use bookmarks;
use gopher;
use gopher::Type;
use help;
use history;
use menu::Menu;
use text::Text;
use utils;
pub type Key = termion::event::Key;
pub type Page = Box<dyn View>;

@ -1,4 +1,4 @@
use ui::Key;
use crate::ui::Key;
#[derive(Debug)]
pub enum Action {

@ -1,5 +1,5 @@
use crate::ui;
use std::fmt;
use ui;
pub trait View: fmt::Display {
fn respond(&mut self, key: ui::Key) -> ui::Action;

@ -1,9 +0,0 @@
use ui;
pub trait View {
fn respond(&mut self, key: ui::Key) -> ui::Action;
fn render(&self) -> String;
fn url(&self) -> String;
fn raw(&self) -> String;
fn term_size(&mut self, cols: usize, rows: usize);
}
Loading…
Cancel
Save