cargo fix + fmt
This commit is contained in:
parent
32f11494c2
commit
8724149a04
@ -35,8 +35,12 @@ impl PullRequest {
|
||||
&self.base.label
|
||||
}
|
||||
|
||||
pub fn number(&self) -> usize { self.number }
|
||||
pub fn title(&self) -> &str { &self.title }
|
||||
pub fn number(&self) -> usize {
|
||||
self.number
|
||||
}
|
||||
pub fn title(&self) -> &str {
|
||||
&self.title
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
|
@ -1,6 +1,6 @@
|
||||
use petgraph::Graph;
|
||||
use std::collections::HashMap;
|
||||
use std::rc::Rc;
|
||||
use petgraph::Graph;
|
||||
|
||||
use crate::api::search::PullRequest;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
use std::collections::HashMap;
|
||||
use std::rc::Rc;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::process;
|
||||
use std::rc::Rc;
|
||||
|
||||
use gh_stack::api;
|
||||
use gh_stack::graph;
|
||||
|
@ -1,8 +1,8 @@
|
||||
use petgraph::{Direction,Graph};
|
||||
use std::rc::Rc;
|
||||
use petgraph::visit::Bfs;
|
||||
use petgraph::visit::EdgeRef;
|
||||
use petgraph::{Direction, Graph};
|
||||
use regex::Regex;
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::api::search::PullRequest;
|
||||
|
||||
@ -25,9 +25,14 @@ pub fn build_table(graph: Graph<Rc<PullRequest>, usize>) -> String {
|
||||
while let Some(node) = bfs.next(&graph) {
|
||||
let parent = graph.edges_directed(node, Direction::Incoming).next();
|
||||
let node: Rc<PullRequest> = graph[node].clone();
|
||||
|
||||
|
||||
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()),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user