Skip to content

Commit b7b573a

Browse files
Replace references of Vec with slices.
There is no need for a Vec where we don't need one. Issue #114
1 parent d7a5f54 commit b7b573a

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/mmscenegraph/rust/src/attr/animdense.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl AnimDenseAttr {
5252
self.values[f] = value;
5353
}
5454

55-
pub fn get_values(&self) -> &Vec<Real> {
55+
pub fn get_values(&self) -> &[Real] {
5656
&self.values
5757
}
5858

src/mmscenegraph/rust/src/math/dag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub fn compute_world_matrices_with_attrs(
204204
tfm_attr_list: &Vec<AttrTransformIds>,
205205
rotate_order_list: &Vec<RotateOrder>,
206206
transform_parents: &Vec<Option<usize>>,
207-
frame_list: &Vec<FrameValue>,
207+
frame_list: &[FrameValue],
208208
out_matrix_list: &mut Vec<Matrix44>,
209209
) {
210210
// println!("Compute World Matrices!");

src/mmscenegraph/rust/src/scene/bake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use crate::scene::graphiter::UpstreamDepthFirstSearch;
4444
/// returned indices.
4545
fn upstream_node_indices_set(
4646
sg: &SceneGraph,
47-
node_ids: &Vec<NodeId>,
47+
node_ids: &[NodeId],
4848
) -> HashSet<PGNodeIndex> {
4949
let graph = &sg.get_graph();
5050
let mut node_indices_set = HashSet::new();
@@ -108,7 +108,7 @@ fn flatten_filter_and_sort_graph_nodes(
108108
/// Get the parent index for each node index given.
109109
fn get_parent_index_list(
110110
sg: &SceneGraph,
111-
node_indices: &Vec<PGNodeIndex>,
111+
node_indices: &[PGNodeIndex],
112112
) -> Vec<Option<usize>> {
113113
let mut list = Vec::<Option<usize>>::new();
114114
let dir = PGDirection::Incoming;

src/mmscenegraph/rust/src/scene/flat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl FlatScene {
118118
pub fn evaluate(
119119
&mut self,
120120
attrdb: &AttrDataBlock,
121-
frame_list: &Vec<FrameValue>,
121+
frame_list: &[FrameValue],
122122
) {
123123
// println!("EVALUATE! =================================================");
124124
let num_frames = frame_list.len();

src/mmscenegraph/rust/src/scene/graph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ impl SceneGraph {
336336

337337
pub fn get_transformable_nodes(
338338
&self,
339-
node_ids: &Vec<NodeId>,
339+
node_ids: &[NodeId],
340340
) -> Option<Vec<Box<dyn NodeCanTransform3D>>> {
341341
let mut nodes = Vec::<Box<dyn NodeCanTransform3D>>::new();
342342
for node_id in node_ids {
@@ -400,7 +400,7 @@ impl SceneGraph {
400400
/// Set all the child_node_ids to have the same parent_node_id
401401
pub fn set_nodes_parent(
402402
&mut self,
403-
child_node_ids: Vec<NodeId>,
403+
child_node_ids: &[NodeId],
404404
parent_node_id: NodeId,
405405
) -> bool {
406406
let node_indices: Vec<PGNodeIndex> = child_node_ids

0 commit comments

Comments
 (0)