Use Self instead of repeating the type name.

This commit is contained in:
Dan Gohman
2017-11-08 10:40:47 -08:00
parent b7f979a8be
commit 3ab4349c1b
41 changed files with 105 additions and 105 deletions

View File

@@ -204,8 +204,8 @@ impl DominatorTree {
impl DominatorTree {
/// Allocate a new blank dominator tree. Use `compute` to compute the dominator tree for a
/// function.
pub fn new() -> DominatorTree {
DominatorTree {
pub fn new() -> Self {
Self {
nodes: EntityMap::new(),
postorder: Vec::new(),
stack: Vec::new(),
@@ -214,8 +214,8 @@ impl DominatorTree {
}
/// Allocate and compute a dominator tree.
pub fn with_function(func: &Function, cfg: &ControlFlowGraph) -> DominatorTree {
let mut domtree = DominatorTree::new();
pub fn with_function(func: &Function, cfg: &ControlFlowGraph) -> Self {
let mut domtree = Self::new();
domtree.compute(func, cfg);
domtree
}