-- Leo's gemini proxy

-- Connecting to typed-hole.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

commit edcda47ec1ddc34d28738b695cc0daa2f79fbe62

Author: Julien Blanchard <julien@sideburns.eu>

Date: Fri Oct 4 17:27:34 2019 +0200


Remove history browser, add bookmarks


diff --git a/Cargo.lock b/Cargo.lock

index bd28038..ee5679f 100644

--- a/Cargo.lock

+++ b/Cargo.lock

@@ -19,10 +19,24 @@ version = "1.0.4"

source = "registry+https://github.com/rust-lang/crates.io-index"


[[package]]

+name = "arrayref"

+version = "0.3.5"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+

+[[package]]

+name = "arrayvec"

+version = "0.4.11"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

name = "asuka"

-version = "0.6.0"

+version = "0.7.0"

dependencies = [

"cursive 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",

+ "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",

"json 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",

"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",

"native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",

@@ -38,11 +52,54 @@ version = "0.1.6"

source = "registry+https://github.com/rust-lang/crates.io-index"


[[package]]

+name = "backtrace"

+version = "0.3.38"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",

+ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",

+ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",

+ "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

+name = "backtrace-sys"

+version = "0.1.31"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)",

+ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

+name = "base64"

+version = "0.10.1"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

name = "bitflags"

version = "1.2.0"

source = "registry+https://github.com/rust-lang/crates.io-index"


[[package]]

+name = "blake2b_simd"

+version = "0.5.8"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",

+ "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",

+ "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

+name = "byteorder"

+version = "1.3.2"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+

+[[package]]

name = "c2-chacha"

version = "0.2.2"

source = "registry+https://github.com/rust-lang/crates.io-index"

@@ -73,6 +130,19 @@ dependencies = [

]


[[package]]

+name = "cloudabi"

+version = "0.0.3"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "bitflags 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

+name = "constant_time_eq"

+version = "0.1.4"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+

+[[package]]

name = "core-foundation"

version = "0.6.4"

source = "registry+https://github.com/rust-lang/crates.io-index"

@@ -162,6 +232,26 @@ dependencies = [

]


[[package]]

+name = "dirs"

+version = "2.0.2"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",

+ "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

+name = "dirs-sys"

+version = "0.3.4"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",

+ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",

+ "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",

+ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

name = "enum-map"

version = "0.6.0"

source = "registry+https://github.com/rust-lang/crates.io-index"

@@ -209,6 +299,26 @@ dependencies = [

]


[[package]]

+name = "failure"

+version = "0.1.5"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "backtrace 0.3.38 (registry+https://github.com/rust-lang/crates.io-index)",

+ "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

+name = "failure_derive"

+version = "0.1.5"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",

+ "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",

+ "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",

+ "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

name = "fnv"

version = "1.0.6"

source = "registry+https://github.com/rust-lang/crates.io-index"

@@ -227,6 +337,11 @@ version = "0.1.1"

source = "registry+https://github.com/rust-lang/crates.io-index"


[[package]]

+name = "fuchsia-cprng"

+version = "0.1.1"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+

+[[package]]

name = "getrandom"

version = "0.1.12"

source = "registry+https://github.com/rust-lang/crates.io-index"

@@ -331,6 +446,11 @@ dependencies = [

]


[[package]]

+name = "nodrop"

+version = "0.1.13"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+

+[[package]]

name = "num"

version = "0.2.0"

source = "registry+https://github.com/rust-lang/crates.io-index"

@@ -504,6 +624,19 @@ dependencies = [


[[package]]

name = "rand_core"

+version = "0.3.1"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

+name = "rand_core"

+version = "0.4.2"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+

+[[package]]

+name = "rand_core"

version = "0.5.1"

source = "registry+https://github.com/rust-lang/crates.io-index"

dependencies = [

@@ -519,11 +652,43 @@ dependencies = [

]


[[package]]

+name = "rand_os"

+version = "0.1.3"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",

+ "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",

+ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",

+ "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",

+ "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",

+ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

+name = "rdrand"

+version = "0.4.0"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

name = "redox_syscall"

version = "0.1.56"

source = "registry+https://github.com/rust-lang/crates.io-index"


[[package]]

+name = "redox_users"

+version = "0.3.1"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",

+ "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",

+ "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)",

+ "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

name = "regex"

version = "1.3.1"

source = "registry+https://github.com/rust-lang/crates.io-index"

@@ -548,6 +713,21 @@ dependencies = [

]


[[package]]

+name = "rust-argon2"

+version = "0.5.1"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",

+ "blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",

+ "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

+name = "rustc-demangle"

+version = "0.1.16"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+

+[[package]]

name = "schannel"

version = "0.1.16"

source = "registry+https://github.com/rust-lang/crates.io-index"

@@ -634,6 +814,17 @@ dependencies = [

]


[[package]]

+name = "synstructure"

+version = "0.10.2"

+source = "registry+https://github.com/rust-lang/crates.io-index"

+dependencies = [

+ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",

+ "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",

+ "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",

+ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",

+]

+

+[[package]]

name = "tempfile"

version = "3.1.0"

source = "registry+https://github.com/rust-lang/crates.io-index"

@@ -776,12 +967,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d"

"checksum arc-swap 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f1a1eca3195b729bbd64e292ef2f5fff6b1c28504fed762ce2b1013dde4d8e92"

"checksum array-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7d034edd76d4e7adc314c95400941dedc89bd4337d565bf87f6b69d3b20dc4de"

+"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee"

+"checksum arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d73f9beda665eaa98ab9e4f7442bd4e7de6652587de55b2525e52e29c1b0ba"

"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875"

+"checksum backtrace 0.3.38 (registry+https://github.com/rust-lang/crates.io-index)" = "690a62be8920ccf773ee00ef0968649b0e724cda8bd5b12286302b4ae955fdf5"

+"checksum backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "82a830b4ef2d1124a711c71d263c5abdc710ef8e907bd508c88be475cebc422b"

+"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"

"checksum bitflags 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a606a02debe2813760609f57a64a2ffd27d9fdf5b2f133eaca0b248dd92cdd2"

+"checksum blake2b_simd 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "5850aeee1552f495dd0250014cf64b82b7c8879a89d83b33bbdace2cc4f63182"

+"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"

"checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101"

"checksum cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)" = "4fc9a35e1f4290eb9e5fc54ba6cf40671ed2a2514c3eeb2b2a908dda2ea5a1be"

"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"

"checksum chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e8493056968583b0193c1bb04d6f7684586f3726992d6c573261941a895dbd68"

+"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"

+"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120"

"checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d"

"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b"

"checksum crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa"

@@ -790,14 +990,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

"checksum darling 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fcfbcb0c5961907597a7d1148e3af036268f2b773886b8bb3eeb1e1281d3d3d6"

"checksum darling_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6afc018370c3bff3eb51f89256a6bdb18b4fdcda72d577982a14954a7a0b402c"

"checksum darling_macro 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c6d8dac1c6f1d29a41c4712b4400f878cb4fcc4c7628f298dd75038e024998d1"

+"checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3"

+"checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b"

"checksum enum-map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7bc0515b284e6ce2cbacd123b339d9c5a0ce49059baa4d9e584ab3803b3dc973"

"checksum enum-map-derive 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e57001dfb2532f5a103ff869656887fae9a8defa7d236f3e39d2ee86ed629ad7"

"checksum enum-map-internals 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8d7f81655c75281b36ddb9c2a1502afcac9db780859cc5b2eba08efcccb4c510"

"checksum enumset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4293261d4f3472132ffdeb1c97be5f5de5267c4a764c6cc10066aeff35a54c"

"checksum enumset_derive 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aeece157d0a6cda3f6015d7f16c570d4ba958161477448a9a6ec49851ccd8ee0"

+"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"

+"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1"

"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"

"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"

"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"

+"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"

"checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571"

"checksum hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1de41fb8dba9714efd92241565cdff73f78508c95697dd56787d3cba27e2353"

"checksum ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"

@@ -812,6 +1017,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"

"checksum native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e"

"checksum ncurses 5.99.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15699bee2f37e9f8828c7b35b2bc70d13846db453f2d507713b758fabe536b82"

+"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"

"checksum num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf4825417e1e1406b3782a8ce92f4d53f26ec055e3622e1881ca8e9f5f9e08db"

"checksum num-complex 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fcb0cf31fb3ff77e6d2a6ebd6800df7fdcd106f2ad89113c9130bcd07f93dffc"

"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09"

@@ -832,12 +1038,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"

"checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412"

"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853"

+"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"

+"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"

"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"

"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"

+"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"

+"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"

"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"

+"checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d"

"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd"

"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716"

"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e"

+"checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf"

+"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"

"checksum schannel 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "87f550b06b6cba9c8b8be3ee73f391990116bf527450d2556e9b9ce263b9a021"

"checksum security-framework 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eee63d0f4a9ec776eeb30e220f0bc1e092c3ad744b2a379e3993070364d3adc2"

"checksum security-framework-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9636f8989cbf61385ae4824b98c1aaa54c994d7d8b41f11c601ed799f0549a56"

@@ -849,6 +1062,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"

"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"

"checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf"

+"checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f"

"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9"

"checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327"

"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"

diff --git a/Cargo.toml b/Cargo.toml

index a6559dc..68c303b 100644

--- a/Cargo.toml

+++ b/Cargo.toml

@@ -1,6 +1,6 @@

[package]

name = "asuka"

-version = "0.6.0"

+version = "0.7.0"

authors = ["Julien Blanchard <julien@sideburns.eu>"]

edition = "2018"


@@ -13,3 +13,4 @@ lazy_static = "*"

open = "*"

json = "*"

tempfile = "*"

+dirs = "*"

diff --git a/src/bookmarks.rs b/src/bookmarks.rs

new file mode 100644

index 0000000..796cd2a

--- /dev/null

+++ b/src/bookmarks.rs

@@ -0,0 +1,39 @@

+extern crate dirs;

+use std::fs::File;

+use std::fs::OpenOptions;

+use std::io::{Read, Write};

+use url::Url;

+

+

+pub fn add(url: &str) {

+ let mut file = bookmarks_file();

+ let entry = format!("{}\n", url);

+ file.write_all(entry.as_bytes())

+ .expect("Unable to write file");

+}

+

+pub fn content() -> Vec<Url> {

+ let mut file = bookmarks_file();

+ let mut content = String::new();

+ file.read_to_string(&mut content)

+ .expect("Unable to read file");

+

+ content

+ .lines()

+ .into_iter()

+ .map(|s| Url::parse(s).unwrap())

+ .collect()

+}

+

+fn bookmarks_file() -> File {

+ let mut bookmarks = dirs::home_dir().unwrap();

+ bookmarks.push(".asuka_bookmarks");

+ let file_path = bookmarks.into_os_string();

+

+ OpenOptions::new()

+ .create(true)

+ .append(true)

+ .read(true)

+ .open(file_path)

+ .expect("file not found")

+}

diff --git a/src/history.rs b/src/history.rs

index ca29775..8b89f83 100644

--- a/src/history.rs

+++ b/src/history.rs

@@ -5,16 +5,6 @@ lazy_static! {

static ref HISTORY: Mutex<Vec<Url>> = Mutex::new(vec![]);

}


-pub fn init() {

- let mut history = HISTORY.lock().unwrap();

- let start_page = Url::parse("gemini://start_page").unwrap();

- history.push(start_page);

-}

-

-pub fn content() -> Vec<Url> {

- HISTORY.lock().unwrap().to_vec()

-}

-

pub fn append(url: &str) {

let url = Url::parse(url).unwrap();

HISTORY.lock().unwrap().push(url)

@@ -41,6 +31,22 @@ pub fn get_current_url() -> Option<String> {

Err(_) => None,

}

}

- None => None,

+ None => None

+ }

+}

+

+pub fn get_previous_url() -> Option<Url> {

+ let mut history = HISTORY.lock().unwrap();

+

+ if history.len() > 1 {

+ history.pop(); // remove current

+

+ if history.len() > 1 {

+ history.pop() // return previous

+ } else {

+ history.iter().cloned().last()

+ }

+ } else {

+ None

}

}

diff --git a/src/main.rs b/src/main.rs

index 13051c5..d271723 100644

--- a/src/main.rs

+++ b/src/main.rs

@@ -24,19 +24,20 @@ mod link;

use link::Link;


mod absolute;

+mod bookmarks;

mod content;

mod history;


const HELP: &str = "Welcome to Asuka Gemini browser!


Press g to visit an URL

- Press h to show/hide history

+ Press b to go to the previous URL

+ Press B to show bookmarks

+ Press a to add current URL to bookmarks

Press q to exit

";


fn main() {

- history::init();

-

let mut siv = Cursive::default();


let theme = custom_colors(&siv);

@@ -55,8 +56,9 @@ fn main() {

))

.title("Asuka Browser")

.h_align(HAlign::Center)

+ .button("Back (b)", |s| go_back(s))

.button("Go To URL (g)", |s| prompt_for_url(s))

- .button("History (h)", |s| show_history(s))

+ .button("Bookmarks (B)", |s| show_bookmarks(s))

.button("Quit (q)", |s| s.quit())

.with_id("container"),

);

@@ -65,8 +67,12 @@ fn main() {

siv.add_global_callback('q', |s| s.quit());

// pressing g prompt for an URL

siv.add_global_callback('g', |s| prompt_for_url(s));

- // pressing h shows/hides history

- siv.add_global_callback('h', |s| show_history(s));

+ // pressing a bookmarks current URL

+ siv.add_global_callback('a', |s| add_bookmark(s));

+ // pressing B shows/hides bookmarks

+ siv.add_global_callback('B', |s| show_bookmarks(s));

+ // pressing b goes to the previous URL if any

+ siv.add_global_callback('b', |s| go_back(s));


siv.run();

}

@@ -118,16 +124,36 @@ fn goto_url(s: &mut Cursive, url: &str) {

};

}


-fn show_history(s: &mut Cursive) {

- // Hide popup when pressing h on an opened popup

- if s.find_id::<Dialog>("history_popup").is_some() {

+fn go_back(s: &mut Cursive) {

+ let previous = history::get_previous_url();

+

+ match previous {

+ Some(url) => goto_url(s, &url.to_string()),

+ None => (),

+ }

+}

+

+fn add_bookmark(s: &mut Cursive) {

+ let current_url = history::get_current_url();

+ match current_url {

+ Some(url) => {

+ bookmarks::add(&url);

+ s.add_layer(Dialog::info("Bookmark added."));

+ }

+ None => (),

+ }

+}

+

+fn show_bookmarks(s: &mut Cursive) {

+ // Hide popup when pressing B on an opened popup

+ if s.find_id::<Dialog>("bookmarks_popup").is_some() {

s.pop_layer();

return;

}


let mut select = SelectView::new();


- for url in history::content().iter().rev() {

+ for url in bookmarks::content().iter().rev() {

let url_s = url.as_str();

select.add_item_str(url_s);

}

@@ -139,8 +165,8 @@ fn show_history(s: &mut Cursive) {


s.add_layer(

Dialog::around(select.scrollable().fixed_size((50, 10)))

- .title("History")

- .with_id("history_popup"),

+ .title("Bookmarks")

+ .with_id("bookmarks_popup"),

);

}




---

Served by Pollux Gemini Server.

-- Response ended

-- Page fetched on Sun May 19 08:40:00 2024