Skip to content

Add a method reverse_segment#2

Open
xvolks wants to merge 4 commits intodevalain:masterfrom
xvolks:bugfix/swap
Open

Add a method reverse_segment#2
xvolks wants to merge 4 commits intodevalain:masterfrom
xvolks:bugfix/swap

Conversation

@xvolks
Copy link
Copy Markdown

@xvolks xvolks commented Feb 22, 2026

pub fn reverse_segment(&mut self, start: usize, count: usize) -> Result<(), &str>

Reverse a part of the list from start for count elements.

Example

# use cdll::CircularList;
let mut saying: CircularList<_> = "reverting is part of coding".chars().collect();
saying.reverse_segment(13, 4);
assert_eq!("reverting is trap of coding", saying.into_iter().collect::<String>())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant