cargo fix + fmt

This commit is contained in:
Timothy Andrew 2020-06-03 00:54:02 +05:30
parent 32f11494c2
commit 8724149a04
No known key found for this signature in database
GPG Key ID: ABD64509E977B249
4 changed files with 17 additions and 8 deletions

View File

@ -35,8 +35,12 @@ impl PullRequest {
&self.base.label &self.base.label
} }
pub fn number(&self) -> usize { self.number } pub fn number(&self) -> usize {
pub fn title(&self) -> &str { &self.title } self.number
}
pub fn title(&self) -> &str {
&self.title
}
} }
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]

View File

@ -1,6 +1,6 @@
use petgraph::Graph;
use std::collections::HashMap; use std::collections::HashMap;
use std::rc::Rc; use std::rc::Rc;
use petgraph::Graph;
use crate::api::search::PullRequest; use crate::api::search::PullRequest;

View File

@ -1,8 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::rc::Rc;
use std::env; use std::env;
use std::error::Error; use std::error::Error;
use std::process; use std::process;
use std::rc::Rc;
use gh_stack::api; use gh_stack::api;
use gh_stack::graph; use gh_stack::graph;

View File

@ -1,8 +1,8 @@
use petgraph::{Direction,Graph};
use std::rc::Rc;
use petgraph::visit::Bfs; use petgraph::visit::Bfs;
use petgraph::visit::EdgeRef; use petgraph::visit::EdgeRef;
use petgraph::{Direction, Graph};
use regex::Regex; use regex::Regex;
use std::rc::Rc;
use crate::api::search::PullRequest; use crate::api::search::PullRequest;
@ -27,7 +27,12 @@ pub fn build_table(graph: Graph<Rc<PullRequest>, usize>) -> String {
let node: Rc<PullRequest> = graph[node].clone(); let node: Rc<PullRequest> = graph[node].clone();
let row = match parent { let row = match parent {
Some(parent) => format!("|#{}|{}|#{}|\n", node.number(), node.title(), graph[parent.source().clone()].number()), Some(parent) => format!(
"|#{}|{}|#{}|\n",
node.number(),
node.title(),
graph[parent.source().clone()].number()
),
None => format!("|#{}|{}|**N/A**|\n", node.number(), node.title()), None => format!("|#{}|{}|**N/A**|\n", node.number(), node.title()),
}; };