Skip to content

Commit a007eb4

Browse files
committed
Make clippy happy,Tag v1.0.0-alpha
1 parent 7faf967 commit a007eb4

File tree

12 files changed

+38
-32
lines changed

12 files changed

+38
-32
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "geopard"
3-
version = "0.1.0"
3+
version = "1.0.0-alpha"
44
authors = ["ranfdev <ranfdev@gmail.com>"]
55
edition = "2018"
66

README.gemini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ Under the hood, it uses gtk3 and rust. Everything related to IO is asynchronous.
2222
To do that, it makes use of rust async/await capabilities and the async-std crate.
2323

2424
# How to change settings
25-
You should find the configuration file in ~/.config/geopard/config.toml
25+
You should find the configuration files in ~/.config/geopard/
26+
If you use flatpak, they are in ~/.var/app/com.ranfdev.Geopard/config/geopard/
2627

2728
## How to build
29+
### With Flatpak
30+
If you have gnome-builder installed, use it to the open the folder of the source
31+
code and hit the run button.
32+
2833
### Build with Nix
2934
If you have the
3035
=> https://nixos.org/ nix

data/com.ranfdev.Geopard.metainfo.xml.in.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<url type="bugtracker">https://github.com/ranfdev/Geopard/issues/</url>
1515
<content_rating type="oars-1.0" />
1616
<releases>
17+
<release version="1.0.0-alpha" date="2021-04-01">
18+
This is the first working flatpak release. Some features (colors, caching)
19+
are missing.
20+
</release>
1721
<release version="0.1.0" date="2020-07-10" />
1822
</releases>
1923
<kudos>

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project('geopard',
22
'rust',
3-
version: '0.0.1',
3+
version: '1.0.0',
44
license: 'MIT',
55
meson_version: '>= 0.50')
66

nix/geopard.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
rustPlatform.buildRustPackage rec {
1515
pname = "geopard";
16-
version = "0.1.0";
16+
version = "1.0.0-alpha";
1717

1818
src = lib.cleanSource ../.;
1919
cargoSha256 = "0b77w95bj6avnxgs5ia93hhq3jr9cmbpa5zw8i37s688633il15x";

src/common/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl DrawCtx {
146146
.fonts
147147
.heading
148148
.as_ref()
149-
.or(default_config.fonts.heading.as_ref())
149+
.or_else(|| default_config.fonts.heading.as_ref())
150150
.unwrap()
151151
});
152152
tag_h1.set_property_size_points(tag_h1.get_property_size_points() * 1.4);
@@ -156,7 +156,7 @@ impl DrawCtx {
156156
.fonts
157157
.heading
158158
.as_ref()
159-
.or(default_config.fonts.heading.as_ref())
159+
.or_else(|| default_config.fonts.heading.as_ref())
160160
.unwrap()
161161
});
162162
tag_h1.set_property_size_points(tag_h1.get_property_size_points() * 1.2);
@@ -167,7 +167,7 @@ impl DrawCtx {
167167
.fonts
168168
.heading
169169
.as_ref()
170-
.or(default_config.fonts.heading.as_ref())
170+
.or_else(|| default_config.fonts.heading.as_ref())
171171
.unwrap(),
172172
);
173173
let tag_pre = DrawCtx::create_tag(
@@ -176,7 +176,7 @@ impl DrawCtx {
176176
.fonts
177177
.preformatted
178178
.as_ref()
179-
.or(default_config.fonts.preformatted.as_ref())
179+
.or_else(|| default_config.fonts.preformatted.as_ref())
180180
.unwrap(),
181181
);
182182
let tag_p = DrawCtx::create_tag(
@@ -185,7 +185,7 @@ impl DrawCtx {
185185
.fonts
186186
.paragraph
187187
.as_ref()
188-
.or(default_config.fonts.paragraph.as_ref())
188+
.or_else(|| default_config.fonts.paragraph.as_ref())
189189
.unwrap(),
190190
);
191191
let tag_q = DrawCtx::create_tag(
@@ -194,7 +194,7 @@ impl DrawCtx {
194194
.fonts
195195
.quote
196196
.as_ref()
197-
.or(default_config.fonts.quote.as_ref())
197+
.or_else(|| default_config.fonts.quote.as_ref())
198198
.unwrap(),
199199
);
200200
tag_q.set_property_style(pango::Style::Italic);
@@ -205,7 +205,7 @@ impl DrawCtx {
205205
.fonts
206206
.quote
207207
.as_ref()
208-
.or(default_config.fonts.paragraph.as_ref())
208+
.or_else(|| default_config.fonts.paragraph.as_ref())
209209
.unwrap(),
210210
);
211211

@@ -235,7 +235,7 @@ impl DrawCtx {
235235
let tag_name = match n {
236236
1 => "h1",
237237
2 => "h2",
238-
3 | _ => "h3",
238+
_ => "h3",
239239
};
240240

241241
let start = text_iter.get_offset();
@@ -291,7 +291,7 @@ impl DrawCtx {
291291
.fonts
292292
.paragraph
293293
.as_ref()
294-
.or(default_config.fonts.paragraph.as_ref())
294+
.or_else(|| default_config.fonts.paragraph.as_ref())
295295
.unwrap();
296296

297297
let tag = gtk::TextTagBuilder::new()
@@ -305,7 +305,7 @@ impl DrawCtx {
305305

306306
Self::set_linkhandler(&tag, link.clone());
307307

308-
let label = label.unwrap_or(link.url());
308+
let label = label.unwrap_or_else(|| link.url());
309309
info!("Setted url {:?} to tag", Self::get_linkhandler(&tag));
310310
debug!("Link set successfully");
311311
self.insert_paragraph(&mut text_iter, &label);

src/component.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ impl<T: glib::IsA<gtk::Widget>, M> Component<T, M> {
3030
}
3131
}
3232
pub fn id(&self) -> usize {
33-
return self.id;
33+
self.id
3434
}
3535
pub fn widget(&self) -> &T {
36-
return &self.widget;
36+
&self.widget
3737
}
3838
pub fn chan(&self) -> flume::Sender<M> {
39-
return self.chan.clone();
39+
self.chan.clone()
4040
}
4141
}

src/gemini/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ impl Parser {
1818
PageElement::Empty
1919
} else if self.inside_pre {
2020
PageElement::Preformatted(line.to_string())
21-
} else if line.starts_with("#") {
21+
} else if line.starts_with('#') {
2222
PageElement::Heading(line.to_string())
23-
} else if line.starts_with(">") {
23+
} else if line.starts_with('>') {
2424
PageElement::Quote(line.to_string())
2525
} else if let Some(captures) = R_GEMINI_LINK.captures(&line) {
2626
match (captures.name("href"), captures.name("label")) {

src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,11 @@ fn main() {
7878
let app_clone = application.clone();
7979
let windows = Rc::new(RefCell::new(vec![]));
8080

81-
let windows_clone = windows.clone();
8281
application.connect_activate(move |_| {
8382
let window = window::Window::new(&app_clone, config.clone());
8483
window.widget().show_all();
8584
window.widget().present();
86-
windows_clone.borrow_mut().push(window);
85+
windows.borrow_mut().push(window);
8786
});
8887

8988
let ret = application.run(&std::env::args().collect::<Vec<String>>());

0 commit comments

Comments
 (0)