From e874d0921616c72dd18e9da8cd62024b089618c8 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Wed, 19 Nov 2014 21:57:43 +0100 Subject: [PATCH] std:num::pow -> std::num::Int::pow --- src/fmt/linebreak.rs | 5 ++--- src/nl/nl.rs | 5 +++-- src/split/split.rs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/fmt/linebreak.rs b/src/fmt/linebreak.rs index 4c0dac617..7ba4c73bf 100644 --- a/src/fmt/linebreak.rs +++ b/src/fmt/linebreak.rs @@ -9,11 +9,10 @@ use FmtOptions; use parasplit::{Paragraph, ParaWords, WordInfo}; -use std::num::{Float, SignedInt}; +use std::num::{Float, Int, SignedInt}; use std::i64; use std::cmp; use std::mem; -use std::num; struct BreakArgs<'a> { opts : &'a FmtOptions, @@ -373,7 +372,7 @@ fn compute_demerits(delta_len: int, stretch: int, wlen: int, prev_rat: f32) -> ( // we penalize lines that have very different ratios from previous lines let bad_delta_r = (DR_MULT * (((ratio - prev_rat) / 2.0).powf(3f32)).abs()) as i64; - let demerits = num::pow(1 + bad_linelen + bad_wordlen + bad_delta_r, 2); + let demerits = Int::pow(1 + bad_linelen + bad_wordlen + bad_delta_r, 2); (demerits, ratio) } diff --git a/src/nl/nl.rs b/src/nl/nl.rs index 0e9b8c7ea..39ce3e56a 100644 --- a/src/nl/nl.rs +++ b/src/nl/nl.rs @@ -19,6 +19,7 @@ extern crate getopts; use std::io::{stdin}; use std::io::BufferedReader; use std::io::fs::File; +use std::num::Int; use std::path::Path; use getopts::{optopt, optflag, getopts, usage, OptGroup}; @@ -164,7 +165,7 @@ fn nl (reader: &mut BufferedReader, settings: &Settings) { let line_no_width_initial = line_no_width; // Stores the smallest integer with one more digit than line_no, so that // when line_no >= line_no_threshold, we need to use one more digit. - let mut line_no_threshold = std::num::pow(10u64, line_no_width); + let mut line_no_threshold = Int::pow(10u64, line_no_width); let mut empty_line_count: u64 = 0; let fill_char = match settings.number_format { NumberFormat::RightZero => '0', @@ -226,7 +227,7 @@ fn nl (reader: &mut BufferedReader, settings: &Settings) { if settings.renumber { line_no = settings.starting_line_number; line_no_width = line_no_width_initial; - line_no_threshold = std::num::pow(10u64, line_no_width); + line_no_threshold = Int::pow(10u64, line_no_width); } &settings.header_numbering }, diff --git a/src/split/split.rs b/src/split/split.rs index 3a11d828c..4282b149b 100644 --- a/src/split/split.rs +++ b/src/split/split.rs @@ -15,7 +15,7 @@ extern crate getopts; extern crate libc; use std::io; -use std::num; +use std::num::Int; use std::char; #[path = "../common/util.rs"] @@ -193,7 +193,7 @@ fn str_prefix(i: uint, width: uint) -> String { let mut w = width; while w > 0 { w -= 1; - let div = num::pow(26 as uint, w); + let div = Int::pow(26 as uint, w); let r = n / div; n -= r * div; c.push(char::from_u32((r as u32) + 97).unwrap()); @@ -208,7 +208,7 @@ fn num_prefix(i: uint, width: uint) -> String { let mut w = width; while w > 0 { w -= 1; - let div = num::pow(10 as uint, w); + let div = Int::pow(10 as uint, w); let r = n / div; n -= r * div; c.push(char::from_digit(r, 10).unwrap());