Skip to content

Commit 2e60649

Browse files
committed
gnostr:cargo apply fmt/sort
1 parent 83f7093 commit 2e60649

File tree

5 files changed

+23
-26
lines changed

5 files changed

+23
-26
lines changed

Cargo.toml

+10-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "gnostr"
33
version = "0.0.2"
44
edition = "2021"
5-
authors = ["gnostr <[email protected]>","extrawurst <[email protected]>", "TODO:add more contributors"]
5+
authors = ["gnostr <[email protected]>", "extrawurst <[email protected]>", "TODO:add more contributors"]
66
description = "gnostr: a git+nostr workflow utility"
77
rust-version = "1.65"
88
exclude = [".github/*", ".vscode/*", "assets/*"]
@@ -13,24 +13,23 @@ license = "MIT"
1313
categories = ["command-line-utilities"]
1414
keywords = ["git", "gui", "cli", "terminal", "ui", "gnostr"]
1515
build = "build.rs"
16-
1716
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1817

1918
[dependencies]
19+
cc = { version = "1.0.88", features = ["libc"] }
20+
getopts = "0.2.21"
21+
git2 = "0.18.2"
22+
gnostr-bins = "0.0.14"
23+
gnostr-xq = { git = "https://github.com/gnostr-org/gnostr-xq.git", version = "0.0.0" }
24+
25+
inline-c = "0.1.7"
2026
# gnostr-bins = { git = "https://github.com/gnostr-org/gnostr-bins.git", version = "0.0.6" }
2127
# gnostr-cli = { git = "https://github.com/gnostr-org/gnostr-cli.git", rev = "60e244cffdcd781f1a22c2c67f31bb3d539624f2" }
2228
k256 = { version = "0.13.3", features = ["schnorr", "ecdh"], path = "vendor/k256" }
29+
libc = "0.2"
2330
rand_core = "0.6"
24-
25-
inline-c = "0.1.7"
26-
sha2 = { version = "0.10.8", path = "vendor/sha2" }
27-
getopts = "0.2.21"
28-
git2 = "0.18.2"
2931
reqwest = { version = "0.11.24", features = ["blocking"] }
30-
gnostr-xq = { git = "https://github.com/gnostr-org/gnostr-xq.git", version = "0.0.0" }
31-
gnostr-bins = "0.0.14"
32-
cc = { version = "1.0.88", features = ["libc"] }
33-
libc = "0.2"
32+
sha2 = { version = "0.10.8", path = "vendor/sha2" }
3433

3534
[build-dependencies]
3635
cc = { version = "1.0.88", features = ["libc"] }

build.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ fn main() {
99
.include("../include/sha256.h")
1010
.include("../include/random.h")
1111
.include("../include/proof.h")
12-
1312
.include("../include/constants.h")
1413
.include("../include/struct_key.h")
1514
.include("../include/struct_args.h")

src/bin/gnostr-reqwest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::io::{Read};
21
use reqwest::Url;
2+
use std::io::Read;
33
fn main() {
44
let url = Url::parse("https://www.rust-lang.org/").unwrap();
55
let mut res = reqwest::blocking::get(url).unwrap();

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
extern crate libc;
22

3-
extern {
3+
extern "C" {
44
pub fn gnostr_get_relays(input: libc::c_int) -> libc::c_int;
55
}
66

src/main.rs

+11-12
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,31 @@ use std::process;
66

77
extern crate gnostr_bins;
88

9+
use gnostr_bins::get_relays;
910
use reqwest::Url;
1011
use std::io::Read;
11-
use gnostr_bins::{get_relays};
1212

1313
use std::time::{SystemTime, UNIX_EPOCH};
1414

1515
extern crate libc;
1616

17-
extern {
17+
extern "C" {
1818
fn double_input(input: libc::c_int) -> libc::c_int;
1919
}
2020

21-
extern {
21+
extern "C" {
2222
///static void gnostr_sha256(int argc, const char* argv[], struct args *args)
2323
fn gnostr_sha256(input: libc::c_int) -> libc::c_int;
2424
}
25-
extern {
25+
extern "C" {
2626
///static int copyx(unsigned char *output, const unsigned char *x32, const unsigned char *y32, void *data)
2727
fn copyx(input: libc::c_int) -> libc::c_int;
2828
}
29-
extern {
29+
extern "C" {
3030
///static void try_subcommand(int argc, const char* argv[])
3131
fn try_subcommand(input: libc::c_int) -> libc::c_int;
3232
}
33-
extern {
33+
extern "C" {
3434
///static void print_hex(unsigned char* data, size_t size)
3535
fn print_hex(input: libc::c_int) -> libc::c_int;
3636
}
@@ -56,7 +56,6 @@ pub fn print_input(inp: &str, out: Option<String>) {
5656
}
5757

5858
fn main() {
59-
6059
let args: Vec<String> = env::args().collect();
6160
let program = args[0].clone();
6261
//REF: https://docs.rs/getopts/latest/getopts/struct.Options.html
@@ -90,10 +89,10 @@ fn main() {
9089
process::exit(0);
9190
}
9291

93-
let _output = matches.opt_str("o");
94-
//leave input as &Option<String>
95-
let _input = matches.opt_str("i");
96-
//deref &str
97-
let _value = _input.as_deref().unwrap_or("100");
92+
let _output = matches.opt_str("o");
93+
//leave input as &Option<String>
94+
let _input = matches.opt_str("i");
95+
//deref &str
96+
let _value = _input.as_deref().unwrap_or("100");
9897
}
9998
}

0 commit comments

Comments
 (0)