Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f66ec2f

Browse files
committed
removed dead code from project module and submodules
1 parent 3da1777 commit f66ec2f

File tree

2 files changed

+7
-33
lines changed

2 files changed

+7
-33
lines changed

src/project/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ use serde::{Serialize, Deserialize};
1818
use crate::board::Board;
1919
use crate::app::code_editor::CodeEditor;
2020

21-
use egui_node_graph::NodeTemplateTrait;
22-
2321
pub mod display;
2422
use display::ProjectViewType;
2523

src/project/system.rs

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ use std::path::Path;
1010
use serde::{Deserialize, Serialize};
1111

1212
use syn::Ident;
13-
use quote::{quote, format_ident};
14-
use proc_macro2::TokenStream;
13+
use quote::quote;
1514

1615
use crate::board::Board;
1716
use crate::board::pinout::InterfaceMapping;
@@ -22,7 +21,6 @@ pub type Result = core::result::Result<(), SystemError>;
2221
#[derive(Debug)]
2322
pub enum SystemError {
2423
BoardNotInSystemError,
25-
UnknownError,
2624
}
2725

2826
/// A Connection is a physical bus connecting two Boards (e.g. I2C, GPIO, SPI, etc).
@@ -38,24 +36,6 @@ pub struct Connection {
3836
pub interface_mapping: InterfaceMapping,
3937
}
4038

41-
impl Connection {
42-
43-
pub fn new(start_board: Board, end_board: Board, iface_mapping: InterfaceMapping) -> Self {
44-
Self {
45-
start_board: start_board,
46-
start_pin: String::new(),
47-
end_board: end_board,
48-
end_pin: String::new(),
49-
interface_mapping: iface_mapping,
50-
}
51-
}
52-
53-
pub fn display(&self, _ctx: &egui::Context, ui: &mut egui::Ui) -> egui::Response {
54-
let label = egui::Label::new(format!("{:?}", self)).sense(egui::Sense::click());
55-
ui.add(label)
56-
}
57-
}
58-
5939
/// A system represents the development boards and their interconnections
6040
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
6141
pub struct System {
@@ -74,12 +54,12 @@ pub struct System {
7454
/// A datastructure that will hold all of the information we need to populate the System module.
7555
#[derive(Default)]
7656
struct TokenStreamAccumulator {
77-
/// A set of crate Idents that need to be included in the source module.
57+
/// A set of crate Idents that need to be included in the system module.
7858
required_bsp_crates: HashSet<Ident>,
79-
/// A vector of <field>: <type> to include in the System struct declaration.
80-
struct_field_and_type_list: Vec<TokenStream>,
81-
/// A vector of <field>: <constructor> to include in the System struct constructor.
82-
struct_field_and_constructor_list: Vec<TokenStream>,
59+
// /// A vector of <field>: <type> to include in the System struct declaration.
60+
// struct_field_and_type_list: Vec<TokenStream>,
61+
// /// A vector of <field>: <constructor> to include in the System struct constructor.
62+
// struct_field_and_constructor_list: Vec<TokenStream>,
8363
}
8464

8565
impl System {
@@ -140,19 +120,15 @@ impl System {
140120
// Fold through the list of connections, and capture the required information
141121
let TokenStreamAccumulator {
142122
required_bsp_crates,
143-
struct_field_and_type_list,
144-
struct_field_and_constructor_list,
123+
..
145124
} = self.connections.iter().fold(TokenStreamAccumulator::default(), |mut acc, elem| {
146125

147126
let Connection {
148127
start_board,
149128
end_board,
150-
interface_mapping,
151129
..
152130
} = elem;
153131

154-
// info!("folding a connection... start_board is \n{}\n end board is\n {}", &start_board.get_name(), &end_board.get_name());
155-
156132
// get starting board info
157133
if let Some(start_board_bsp_info) = &start_board.bsp_parse_info {
158134
info!(" found some bsp info");

0 commit comments

Comments
 (0)