This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn extract_count(spaces: HashMap<usize, usize>) -> Result<usize, String> { | |
if spaces.len() < 3 { | |
return Err(String::from("Couldn't guess: Too few lines.")) | |
} | |
let mut result: [(usize, usize); 3] = [(0, 0); 3]; | |
for (key, value) in spaces.iter() { | |
if value > &result[0].1 { | |
result[0] = (*key, *value); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for line in lines { | |
match Indentation::parse_line(&line) { | |
Ok(Some(Indentation::Spaces(size))) => { *spaces.entry(size).or_insert(0) += 1; }, // Derp | |
Ok(Some(Indentation::Tabs)) => tabs = true, | |
Ok(None) => continue, | |
Err(e) => return Err(e), | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using Quickpay; | |
// using RestSharp; | |
public object GetPayment(Invoice invoice) | |
{ | |
Action<RestRequest> prepareRequest = (RestRequest request) => | |
{ | |
request.Method = Method.POST; | |
request.AddParameter("order_id", invoice.Id); | |
request.AddParameter("currency", "DKK"); |
NewerOlder