Compare commits
2 commits
e05823a4d9
...
06c01356e8
Author | SHA1 | Date | |
---|---|---|---|
06c01356e8 | |||
195d5f0770 |
1 changed files with 7 additions and 7 deletions
14
src/main.rs
14
src/main.rs
|
@ -8,13 +8,13 @@ use std::fs::OpenOptions;
|
|||
use std::io::Read;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn truncate(s: String, size: usize) -> String {
|
||||
if s.len() > size {
|
||||
let mut s = s;
|
||||
s.truncate(size - 3);
|
||||
format!("{}...", s)
|
||||
fn truncate(string: String, size: usize) -> String {
|
||||
if string.len() > size {
|
||||
let mut string = string;
|
||||
string.truncate(size - 3);
|
||||
format!("{}...", string)
|
||||
} else {
|
||||
s
|
||||
string
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ fn print_pull_request(pull_request: &PullRequest) {
|
|||
|
||||
fn print_pull_requests(pull_requests: &Vec<PullRequest>) {
|
||||
if pull_requests.is_empty() {
|
||||
println!("\x1b[31;1mNo pull requests\x1b[0m");
|
||||
println!("\x1b[92;1mNo pull requests\x1b[0m");
|
||||
}
|
||||
for pull_request in pull_requests {
|
||||
println!();
|
||||
|
|
Loading…
Reference in a new issue