Skip to content

Commit 9e52b18

Browse files
author
Ian
committed
Added sum trait to numeric ops and float ops
1 parent 8afd553 commit 9e52b18

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "single-utilities"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
edition = "2024"
55
description = "This crate provdes types, traits and utility functions to the single-rust ecosystem that can be universally used. You can also use it within your own ecosystem 👀"
66
homepage = "https://singlerust.com"

src/traits/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
use std::iter::Sum;
12
use num_traits::{Bounded, FromPrimitive, NumCast, One, ToPrimitive, Zero};
23
use std::ops::{Add, AddAssign, MulAssign};
34

45
pub trait NumericOps:
5-
Zero + One + NumCast + Copy + AddAssign + MulAssign + PartialOrd + Bounded + Add<Output = Self>
6+
Zero + One + NumCast + Copy + AddAssign + MulAssign + PartialOrd + Bounded + Add<Output = Self> + Sum
67
{
78
}
89
impl<
9-
T: Zero + One + NumCast + Copy + AddAssign + MulAssign + PartialOrd + Bounded + Add<Output = Self>,
10+
T: Zero + One + NumCast + Copy + AddAssign + MulAssign + PartialOrd + Bounded + Add<Output = Self> + Sum,
1011
> NumericOps for T
1112
{
1213
}

0 commit comments

Comments
 (0)