Change spaces to tab

This commit is contained in:
Dima Kudosh
2016-02-29 14:05:31 +03:00
parent 37b2c3697e
commit 0035a1b816
5 changed files with 448 additions and 448 deletions
+29 -29
View File
@@ -7,45 +7,45 @@ pub fn calculate_ratio(matches: usize, length: usize) -> f32{
pub fn str_with_similar_chars(c: char, length: usize) -> String {
let mut s = String::new();
for _ in 0..length{
s.push_str(&c.to_string());
}
s
let mut s = String::new();
for _ in 0..length{
s.push_str(&c.to_string());
}
s
}
pub fn count_leading(line: &str, c: char) -> usize {
let (mut i, n) = (0, line.len());
let line: Vec<char> = line.chars().collect();
while (i < n) && line[i] == c {
i += 1;
}
return i
let (mut i, n) = (0, line.len());
let line: Vec<char> = line.chars().collect();
while (i < n) && line[i] == c {
i += 1;
}
return i
}
pub fn format_range_unified(start:usize, end: usize) -> String {
let mut beginning = start + 1;
let length = end - start;
if length == 1 {
return beginning.to_string()
}
if length == 0 {
beginning -= 1;
}
format!("{},{}", beginning, length)
let mut beginning = start + 1;
let length = end - start;
if length == 1 {
return beginning.to_string()
}
if length == 0 {
beginning -= 1;
}
format!("{},{}", beginning, length)
}
pub fn format_range_context(start: usize, end: usize) -> String {
let mut beginning = start + 1;
let length = end - start;
if length == 0 {
beginning -= 1
}
if length <= 1 {
return beginning.to_string()
}
format!("{},{}", beginning, beginning + length - 1)
let mut beginning = start + 1;
let length = end - start;
if length == 0 {
beginning -= 1
}
if length <= 1 {
return beginning.to_string()
}
format!("{},{}", beginning, beginning + length - 1)
}