Skip to content

Instantly share code, notes, and snippets.

@dbrgn
Created April 16, 2015 14:15
Show Gist options
  • Select an option

  • Save dbrgn/22c89e19cefcf5bd1f49 to your computer and use it in GitHub Desktop.

Select an option

Save dbrgn/22c89e19cefcf5bd1f49 to your computer and use it in GitHub Desktop.
fn divisors<T : Add + Div + Rem>(number: T) -> Iterator<Item=T> {
(2..number/2+1).filter(|&x| number % x == 0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment