mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Update some code that's feature-gated under core.
This commit is contained in:
parent
29a36adbe7
commit
ba87666cdb
33 changed files with 104 additions and 107 deletions
|
@ -44,7 +44,7 @@ impl Formatable for Option<TimerMetadata> {
|
|||
match self {
|
||||
// TODO(cgaebel): Center-align in the format strings as soon as rustc supports it.
|
||||
&Some(ref meta) => {
|
||||
let url = meta.url.as_slice();
|
||||
let url = &*meta.url;
|
||||
let url = if url.len() > 30 {
|
||||
&url[..30]
|
||||
} else {
|
||||
|
@ -243,7 +243,7 @@ impl TimeProfiler {
|
|||
if data_len > 0 {
|
||||
let (mean, median, min, max) =
|
||||
(data.iter().map(|&x|x).sum() / (data_len as f64),
|
||||
data.as_slice()[data_len / 2],
|
||||
data[data_len / 2],
|
||||
data.iter().fold(f64::INFINITY, |a, &b| a.min(b)),
|
||||
data.iter().fold(-f64::INFINITY, |a, &b| a.max(b)));
|
||||
println!("{:-35}{} {:15.4} {:15.4} {:15.4} {:15.4} {:15}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue