Skip to content

Commit d1142fd

Browse files
committed
Fix pre-commit hook, fmt
1 parent fef3aa3 commit d1142fd

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

hooks/pre-commit.hook

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
#!/bin/env sh
1+
#!/usr/bin/env sh
22
#
33
# An example hook script to verify what is about to be committed.
44
# Called by "git commit" with no arguments. The hook should
55
# exit with non-zero status after issuing an appropriate message if
66
# it wants to stop the commit.
77

8-
cargo fmt --check
9-
cargo clippy
8+
cargo fmt --check

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ if get_option('profile') == 'development'
5959
# Setup pre-commit hook for ensuring coding style is always consistent
6060
message('Setting up git pre-commit hook..')
6161
run_command('cp', '-f', 'hooks/pre-commit.hook', '.git/hooks/pre-commit')
62+
run_command('chmod', '+x', '.git/hooks/pre-commit')
6263
endif
6364

6465
subdir('data')

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ mod build_config;
1414
mod common;
1515
mod config;
1616
mod download_page;
17-
mod text_extensions;
1817
mod gemini;
1918
mod input_page;
2019
mod macros;
2120
mod tab;
21+
mod text_extensions;
2222
mod window;
2323

2424
use gtk::prelude::*;

src/tab.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use futures::io::BufReader;
55
use futures::prelude::*;
66
use futures::task::LocalSpawnExt;
77
use glib::{clone, Properties};
8+
use gtk::gdk;
89
use gtk::gdk::prelude::*;
910
use gtk::gio;
1011
use gtk::glib;
@@ -19,12 +20,11 @@ use std::marker::PhantomData;
1920
use std::pin::Pin;
2021
use std::rc::Rc;
2122
use url::Url;
22-
use gtk::gdk;
2323

2424
use crate::common;
2525
use crate::common::{glibctx, HistoryItem, LossyTextRead, PageElement};
26-
use crate::text_extensions::Gemini as GeminiTextExt;
2726
use crate::gemini;
27+
use crate::text_extensions::Gemini as GeminiTextExt;
2828

2929
#[derive(Clone, Debug, glib::Boxed, Default)]
3030
#[boxed_type(name = "GeopardHistoryStatus")]
@@ -196,7 +196,9 @@ impl Tab {
196196
let link = Self::extract_linkhandler(gemini_text_ext, x, y);
197197
match link {
198198
Ok(_) => {
199-
gemini_text_ext.text_view.set_cursor_from_name(Some("pointer"));
199+
gemini_text_ext
200+
.text_view
201+
.set_cursor_from_name(Some("pointer"));
200202
}
201203
Err(_) => {
202204
gemini_text_ext.text_view.set_cursor_from_name(Some("text"));
@@ -431,7 +433,12 @@ impl Tab {
431433
Ok(())
432434
}
433435
async fn send_request(&self, url: Url) -> Result<Option<Vec<u8>>> {
434-
self.imp().gemini_text_ext.borrow_mut().as_mut().unwrap().clear();
436+
self.imp()
437+
.gemini_text_ext
438+
.borrow_mut()
439+
.as_mut()
440+
.unwrap()
441+
.clear();
435442
match url.scheme() {
436443
"about" => {
437444
let reader = futures::io::BufReader::new(common::ABOUT_PAGE.as_bytes());
@@ -584,10 +591,7 @@ impl Tab {
584591

585592
Ok(())
586593
}
587-
async fn display_text(
588-
&self,
589-
mut stream: impl AsyncBufRead + Unpin,
590-
) -> anyhow::Result<()> {
594+
async fn display_text(&self, mut stream: impl AsyncBufRead + Unpin) -> anyhow::Result<()> {
591595
let gemini_text_ext = self.imp().gemini_text_ext.borrow();
592596
let gemini_text_ext = gemini_text_ext.as_ref().unwrap();
593597
let mut line = String::with_capacity(1024);
@@ -723,7 +727,7 @@ impl Tab {
723727
Ok(data.into_bytes())
724728
}
725729
pub fn set_link_color(&self, rgba: &gdk::RGBA) {
726-
self.imp()
730+
self.imp()
727731
.gemini_text_ext
728732
.borrow()
729733
.as_ref()

src/window.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ impl Window {
438438
.borrow()
439439
.load_from_data(stylesheet.as_bytes());
440440
// FIXME: Should add a method on `Tab`...
441-
self.current_tab().set_link_color(&self.style_context().lookup_color("accent_color").unwrap());
441+
self.current_tab()
442+
.set_link_color(&self.style_context().lookup_color("accent_color").unwrap());
442443
}
443444

444445
fn is_small_screen(&self) -> bool {

0 commit comments

Comments
 (0)