Skip to content

Commit

Permalink
Remove seq from new_sequence()
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNachoBIT committed Sep 28, 2024
1 parent 5a78a5d commit 6ac2594
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,14 @@ fn tline_set_by_timestamp() {
fn tline_new_sequence() {
let mut timeline = Timeline::new(Framerate::Fixed(24.0));

let mut sequence_one: &mut Sequence<i64> = timeline.new_sequence(Sequence::new()).unwrap();
let mut sequence_one: &mut Sequence<i64> = timeline.new_sequence().unwrap();

assert!(sequence_one
.add_keyframe_at_timestamp(Keyframe { value: 3 }, &tcode_hmsf!(00:00:05:00))
.is_some());

let mut sequence_two: &mut Sequence<i32> = timeline.new_sequence(Sequence::new()).unwrap();
let mut sequence_two: &mut Sequence<i32> = timeline.new_sequence().unwrap();

assert!(sequence_two
.add_keyframe_at_timestamp(Keyframe { value: 6 }, &tcode_hmsf!(00:00:10:00))
.is_some());
Expand Down
4 changes: 2 additions & 2 deletions src/timeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,13 @@ impl Timeline {
}
}

pub fn new_sequence<T: 'static>(&mut self, seq: Sequence<T>) -> Option<&mut Sequence<T>> {
pub fn new_sequence<T: 'static>(&mut self) -> Option<&mut Sequence<T>> {
if self.sequences.get::<Vec<Sequence<T>>>().is_none() {
self.sequences.insert(Vec::<Sequence<T>>::new());
}

let mut seq_list = self.sequences.get_mut::<Vec<Sequence<T>>>().unwrap();
seq_list.push(seq);
seq_list.push(Sequence::<T>::new());

seq_list.last_mut()
}
Expand Down

0 comments on commit 6ac2594

Please sign in to comment.