Skip to content

Commit bfaa16b

Browse files
authored
Merge pull request #22 from indiv0/dev
Apply rustfmt
2 parents 793e754 + 2d72d15 commit bfaa16b

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

rustfmt.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
enum_trailing_comma = true
2+
fn_args_density = "Compressed"
23
fn_args_layout = "Block"
34
format_strings = false
5+
ideal_width = 80
46
match_block_trailing_comma = true
57
match_wildcard_trailing_comma = true
8+
max_width = 99
69
normalize_comments = false
7-
struct_trailing_comma = "Always"
8-
struct_lit_trailing_comma = "Always"
9-
reorder_imports = true
1010
reorder_imported_names = true
11-
report_todo = "Always"
11+
reorder_imports = true
1212
report_fixme = "Always"
13+
report_todo = "Always"
14+
struct_lit_trailing_comma = "Vertical"
15+
struct_trailing_comma = "Vertical"
1316
where_trailing_comma = true
17+
wrap_comments = true
1418
write_mode = "Overwrite"

src/lib.rs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,15 @@ pub trait WolframAlphaRequestSender {
6666
///
6767
/// Takes a map of parameters which get appended to the request as query
6868
/// parameters. Returns the response body string.
69-
fn send<'a>(
70-
&self,
71-
method: &str,
72-
params: &mut HashMap<&str, &'a str>
73-
) -> HttpRequestResult<String>;
69+
fn send<'a>(&self, method: &str, params: &mut HashMap<&str, &'a str>)
70+
-> HttpRequestResult<String>;
7471

7572
/// Make an API call to Wolfram|Alpha that contains the configured App ID.
7673
///
7774
/// Takes a map of parameters which get appended to the request as query
7875
/// parameters. Returns the response body string.
79-
fn send_authed<'a>(
80-
&self,
81-
method: &str,
82-
app_id: &'a str,
83-
params: &mut HashMap<&str, &'a str>
84-
) -> HttpRequestResult<String> {
76+
fn send_authed<'a>(&self, method: &str, app_id: &'a str, params: &mut HashMap<&str, &'a str>)
77+
-> HttpRequestResult<String> {
8578
params.insert("appid", app_id);
8679
self.send(method, params)
8780
}
@@ -97,11 +90,8 @@ mod hyper_support {
9790
use url::Url;
9891

9992
impl WolframAlphaRequestSender for hyper::Client {
100-
fn send<'a>(
101-
&self,
102-
method: &str,
103-
params: &mut HashMap<&str, &'a str>
104-
) -> HttpRequestResult<String> {
93+
fn send<'a>(&self, method: &str, params: &mut HashMap<&str, &'a str>)
94+
-> HttpRequestResult<String> {
10595
let url_string = format!("https://api.wolframalpha.com/v2/{}", method);
10696
let mut url = url_string.parse::<Url>().expect("Unable to parse URL");
10797

src/query.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ pub struct OptionalQueryParameters<'a> {
5050

5151
/// Performs a query to the Wolfram|Alpha API.
5252
pub fn query<R>(
53-
client: &R,
54-
appid: &str,
55-
input: &str,
53+
client: &R, appid: &str, input: &str,
5654
optional_query_parameters: Option<OptionalQueryParameters>
5755
) -> Result<QueryResult>
5856
where R: WolframAlphaRequestSender,

0 commit comments

Comments
 (0)