Skip to content

Commit 9e6b6b4

Browse files
committed
remove unnecessary unsafe blocks
1 parent a1b9fd9 commit 9e6b6b4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

gmp.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,9 @@ impl Mpq {
641641
642642
impl Clone for Mpq {
643643
fn clone(&self) -> Mpq {
644-
unsafe {
645-
let mut res = Mpq::new();
646-
res.set(self);
647-
res
648-
}
644+
let mut res = Mpq::new();
645+
res.set(self);
646+
res
649647
}
650648
}
651649
@@ -733,15 +731,15 @@ impl IntConvertible for Mpq {
733731
}
734732
fn from_int(other: int) -> Mpq {
735733
let mut res = Mpq::new();
736-
unsafe { res.set_z(&from_int(other)); } // purity workaround
734+
res.set_z(&from_int(other));
737735
res
738736
}
739737
}
740738
741739
impl One for Mpq {
742740
fn one() -> Mpq {
743741
let mut res = Mpq::new();
744-
unsafe { __gmpq_set_ui(&mut res.mpq, 1, 1) } // purity
742+
unsafe { __gmpq_set_ui(&mut res.mpq, 1, 1) }
745743
res
746744
}
747745
}

0 commit comments

Comments
 (0)