mirror of
https://github.com/house-of-vanity/rexec.git
synced 2025-07-07 00:54:06 +00:00
Format Rust code using rustfmt
This commit is contained in:
committed by
GitHub
parent
ad2d36bb35
commit
e071381e03
11
src/main.rs
11
src/main.rs
@ -94,11 +94,11 @@ fn expand_string(s: &str) -> Vec<Host> {
|
||||
let start = r.find('[').unwrap();
|
||||
let end = r.find(']').unwrap();
|
||||
let colon = r.find(':').unwrap();
|
||||
let low = r[start+1..colon].parse::<i32>().unwrap();
|
||||
let high = r[colon+1..end].parse::<i32>().unwrap();
|
||||
let low = r[start + 1..colon].parse::<i32>().unwrap();
|
||||
let high = r[colon + 1..end].parse::<i32>().unwrap();
|
||||
result.retain(|s| s != &r);
|
||||
for val in expand_range(low, high) {
|
||||
let new_str = format!("{}{}{}", &r[..start], val, &r[end+1..]);
|
||||
let new_str = format!("{}{}{}", &r[..start], val, &r[end + 1..]);
|
||||
result.push(new_str);
|
||||
}
|
||||
}
|
||||
@ -107,10 +107,10 @@ fn expand_string(s: &str) -> Vec<Host> {
|
||||
let r = r.clone();
|
||||
let start = r.find('{').unwrap();
|
||||
let end = r.find('}').unwrap();
|
||||
let list = &r[start+1..end];
|
||||
let list = &r[start + 1..end];
|
||||
result.retain(|s| s != &r);
|
||||
for val in expand_list(list) {
|
||||
let new_str = format!("{}{}{}", &r[..start], val, &r[end+1..]);
|
||||
let new_str = format!("{}{}{}", &r[..start], val, &r[end + 1..]);
|
||||
result.push(new_str);
|
||||
}
|
||||
}
|
||||
@ -124,7 +124,6 @@ fn expand_string(s: &str) -> Vec<Host> {
|
||||
hosts
|
||||
}
|
||||
|
||||
|
||||
fn main() {
|
||||
env_logger::Builder::from_env(Env::default().default_filter_or("info"))
|
||||
.format_timestamp(None)
|
||||
|
Reference in New Issue
Block a user