Skip to content

Commit f9430e9

Browse files
committed
Refactor gemini lib into crate, fix unused var warnings
1 parent 582f41a commit f9430e9

File tree

11 files changed

+46
-12
lines changed

11 files changed

+46
-12
lines changed

Cargo.lock

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "1.0.1"
44
authors = ["ranfdev <[email protected]>"]
55
edition = "2021"
66

7+
[workspace]
78

89
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
910

@@ -13,12 +14,12 @@ git = "https://github.com/gtk-rs/gtk4-rs.git"
1314
features = ["v4_6"]
1415

1516
[dependencies]
17+
gemini = { path = "gemini" }
1618
async-net = "1.4.7"
1719
async-fs = "1.5.0"
1820
url = "2.1.1"
1921
thiserror = "1.0.20"
2022
futures = "0.3.5"
21-
regex = "1.3.9"
2223
once_cell = "1.4.0"
2324
anyhow = "1.0.32"
2425
async-trait = "0.1.38"

gemini/Cargo.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[package]
2+
name = "gemini"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[lib]
7+
8+
[dependencies]
9+
once_cell = "1.4.0"
10+
regex = "1.3.9"
11+
async-net = "1.4.7"
12+
futures = "0.3.5"
13+
log = "0.4.0"
14+
url = "2.1.1"
15+
thiserror = "1.0.20"
16+
async-native-tls = "0.3.3"
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub enum PageElement {
1313
Empty,
1414
}
1515

16+
#[derive(Debug, Clone, Default)]
1617
pub struct Parser {
1718
inside_pre: bool,
1819
}

src/build_config.rs.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub const APP_ID: &str = @APP_ID@;
2-
pub const GETTEXT_PACKAGE: &str = @GETTEXT_PACKAGE@;
3-
pub const LOCALEDIR: &str = @LOCALEDIR@;
4-
pub const PKGDATADIR: &str = @PKGDATADIR@;
5-
pub const PROFILE: &str = @PROFILE@;
2+
pub const _GETTEXT_PACKAGE: &str = @GETTEXT_PACKAGE@;
3+
pub const _LOCALEDIR: &str = @LOCALEDIR@;
4+
pub const _PKGDATADIR: &str = @PKGDATADIR@;
5+
pub const _PROFILE: &str = @PROFILE@;
66
pub const RESOURCES_FILE: &str = concat!(@PKGDATADIR@, "/resources.gresource");
77
pub const VERSION: &str = @VERSION@;

src/common/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ pub static DOWNLOAD_PATH: Lazy<std::path::PathBuf> = Lazy::new(|| {
1515

1616
pub static ABOUT_PAGE: &str = std::include_str!("../../README.gemini");
1717

18-
pub const MARGIN: i32 = 20;
19-
2018
pub static DATA_DIR_PATH: Lazy<std::path::PathBuf> =
2119
Lazy::new(|| glib::user_data_dir().join("geopard"));
2220

src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use std::rc::Rc;
1313
mod build_config;
1414
mod common;
1515
mod config;
16-
mod gemini;
1716
mod lossy_text_read;
1817
mod macros;
1918
mod text_extensions;

src/text_extensions/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/// Composable extensions over `gtk::TextEditor`
22
mod gemini;
3-
pub use gemini::*;
3+
pub use self::gemini::*;

0 commit comments

Comments
 (0)