Skip to content

Instantly share code, notes, and snippets.

@umurgdk
Created June 24, 2017 08:43
Show Gist options
  • Select an option

  • Save umurgdk/9aac5e3804a126a9ee645ba17a810a07 to your computer and use it in GitHub Desktop.

Select an option

Save umurgdk/9aac5e3804a126a9ee645ba17a810a07 to your computer and use it in GitHub Desktop.
pub fn remove_child(&mut self, child: &Box<View>) -> Option<Box<View>>
{
match self.children.iter().position(|v| ptr::eq(v, child)) {
Some(index) => Some(self.children.remove(index)),
None => None
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment