Skip to content
Snippets Groups Projects
Commit ec23852f authored by Denis Smirnov's avatar Denis Smirnov
Browse files

refactoring: rename Plan::empty() to Plan::new()

parent 24596a0b
No related branches found
No related tags found
1 merge request!1414sbroad import
......@@ -87,6 +87,12 @@ pub struct Plan {
top: Option<usize>,
}
impl Default for Plan {
fn default() -> Self {
Self::new()
}
}
#[allow(dead_code)]
impl Plan {
/// Add relation to the plan.
......@@ -126,7 +132,7 @@ impl Plan {
/// Constructor for an empty plan structure.
#[must_use]
pub fn empty() -> Self {
pub fn new() -> Self {
Plan {
nodes: Nodes { arena: Vec::new() },
relations: None,
......
......@@ -7,7 +7,7 @@ use std::path::Path;
#[test]
fn proj_preserve_dist_key() {
let mut plan = Plan::empty();
let mut plan = Plan::new();
let t = Table::new_seg(
"t",
......
......@@ -10,7 +10,7 @@ use std::path::Path;
#[test]
fn scan_rel() {
let mut plan = Plan::empty();
let mut plan = Plan::new();
let t = Table::new_seg(
"t",
......@@ -47,7 +47,7 @@ fn scan_rel() {
#[test]
fn scan_rel_serialized() {
let mut plan = Plan::empty();
let mut plan = Plan::new();
let t = Table::new_seg(
"t",
......@@ -82,7 +82,7 @@ fn scan_rel_serialized() {
#[test]
fn projection() {
let mut plan = Plan::empty();
let mut plan = Plan::new();
let t = Table::new_seg(
"t",
......@@ -132,7 +132,7 @@ fn projection_serialize() {
#[test]
fn selection() {
let mut plan = Plan::empty();
let mut plan = Plan::new();
let t = Table::new_seg(
"t",
......@@ -184,7 +184,7 @@ fn selection_serialize() {
#[test]
fn union_all() {
let mut plan = Plan::empty();
let mut plan = Plan::new();
let t1 = Table::new_seg("t1", vec![Column::new("a", Type::Number)], &["a"]).unwrap();
plan.add_rel(t1);
......@@ -199,7 +199,7 @@ fn union_all() {
#[test]
fn union_all_col_amount_mismatch() {
let mut plan = Plan::empty();
let mut plan = Plan::new();
let t1 = Table::new_seg(
"t1",
......@@ -227,7 +227,7 @@ fn union_all_col_amount_mismatch() {
#[test]
fn sub_query() {
let mut plan = Plan::empty();
let mut plan = Plan::new();
let t = Table::new_seg(
"t",
......
......@@ -34,7 +34,7 @@ fn plan_oor_top() {
#[test]
fn get_node() {
let mut plan = Plan::empty();
let mut plan = Plan::new();
let t = Table::new_seg("t", vec![Column::new("a", Type::Boolean)], &["a"]).unwrap();
plan.add_rel(t);
......@@ -52,7 +52,7 @@ fn get_node() {
#[test]
fn get_node_oor() {
let plan = Plan::empty();
let plan = Plan::new();
assert_eq!(
QueryPlannerError::ValueOutOfRange,
plan.get_node(42).unwrap_err()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment