Skip to content

Commit

Permalink
Assume const fn support
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Jan 17, 2020
1 parent ccbbf7d commit 69247ad
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
4 changes: 0 additions & 4 deletions Cargo.toml
Expand Up @@ -10,7 +10,6 @@ name = "num-complex"
repository = "https://github.com/rust-num/num-complex"
version = "0.3.0-pre"
readme = "README.md"
build = "build.rs"
exclude = ["/ci/*", "/.travis.yml", "/bors.toml"]
publish = false

Expand All @@ -37,6 +36,3 @@ default-features = false
[features]
default = ["std"]
std = ["num-traits/std"]

[build-dependencies]
autocfg = "1"
12 changes: 0 additions & 12 deletions build.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/lib.rs
Expand Up @@ -93,19 +93,11 @@ pub type Complex32 = Complex<f32>;
pub type Complex64 = Complex<f64>;

impl<T> Complex<T> {
#[cfg(has_const_fn)]
/// Create a new Complex
#[inline]
pub const fn new(re: T, im: T) -> Self {
Complex { re: re, im: im }
}

#[cfg(not(has_const_fn))]
/// Create a new Complex
#[inline]
pub fn new(re: T, im: T) -> Self {
Complex { re: re, im: im }
}
}

impl<T: Clone + Num> Complex<T> {
Expand Down Expand Up @@ -2647,7 +2639,6 @@ mod test {
assert!(c.is_one());
}

#[cfg(has_const_fn)]
#[test]
fn test_const() {
const R: f64 = 12.3;
Expand Down

0 comments on commit 69247ad

Please sign in to comment.