{"action":"created","issue":{"url":"https://api.github.com/repos/mmstick/systemd-manager/issues/6","repository_url":"https://api.github.com/repos/mmstick/systemd-manager","labels_url":"https://api.github.com/repos/mmstick/systemd-manager/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/mmstick/systemd-manager/issues/6/comments","events_url":"https://api.github.com/repos/mmstick/systemd-manager/issues/6/events","html_url":"https://github.com/mmstick/systemd-manager/issues/6","id":155164902,"number":6,"title":"ParseFloatError on startup","user":{"login":"gmorenz","id":595972,"avatar_url":"https://avatars.githubusercontent.com/u/595972?v=3","gravatar_id":"","url":"https://api.github.com/users/gmorenz","html_url":"https://github.com/gmorenz","followers_url":"https://api.github.com/users/gmorenz/followers","following_url":"https://api.github.com/users/gmorenz/following{/other_user}","gists_url":"https://api.github.com/users/gmorenz/gists{/gist_id}","starred_url":"https://api.github.com/users/gmorenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmorenz/subscriptions","organizations_url":"https://api.github.com/users/gmorenz/orgs","repos_url":"https://api.github.com/users/gmorenz/repos","events_url":"https://api.github.com/users/gmorenz/events{/privacy}","received_events_url":"https://api.github.com/users/gmorenz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-05-17T02:40:09Z","updated_at":"2016-05-17T16:44:36Z","closed_at":null,"body":"This is on Arch Linux, with a pretty normal setup.\r\n\r\n```\r\n[normal@malware systemd-manager]$ RUST_BACKTRACE=1 cargo run\r\n     Running `target/debug/systemd-manager`\r\nthread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: ParseFloatError { kind: Invalid }', ../src/libcore/result.rs:785\r\nstack backtrace:\r\n   1:     0x563829b27740 - std::sys::backtrace::tracing::imp::write::h9fb600083204ae7f\r\n   2:     0x563829b2b6db - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hca543c34f11229ac\r\n   3:     0x563829b2b363 - std::panicking::default_hook::hc2c969e7453d080c\r\n   4:     0x563829b1e0ff - std::sys_common::unwind::begin_unwind_inner::h30e12d15ce2b2e25\r\n   5:     0x563829b1ec08 - std::sys_common::unwind::begin_unwind_fmt::hb2de8a9968d38523\r\n   6:     0x563829b26b01 - rust_begin_unwind\r\n   7:     0x563829b6191f - core::panicking::panic_fmt::h257ceb0aa351d801\r\n   8:     0x563829ac4811 - core::result::unwrap_failed::h9a4f9b64476df8f7\r\n                        at ../src/libcore/macros.rs:29\r\n   9:     0x563829ac46c0 - _<std..result..Result<T, E>>::unwrap::h25badbe3cadff716\r\n                        at ../src/libcore/result.rs:723\r\n  10:     0x563829ac3da9 - systemd_manager::systemd_analyze::blame::parse_time::haaf3c3e3c90cd5be\r\n                        at src/systemd_analyze.rs:15\r\n  11:     0x563829abdcb2 - systemd_manager::systemd_analyze::blame::_$u7b$$u7b$closure$u7d$$u7d$::hafa9fe49e98a7bb9\r\n                        at src/systemd_analyze.rs:24\r\n  12:     0x563829abdb9b - core::ops::impls::_<impl std..ops..FnOnce<A> for &'a mut F>::call_once::h2356c29ef45f6a76\r\n                        at ../src/libcore/ops.rs:1998\r\n  13:     0x563829abdb1f - _<std..option..Option<T>>::map::h9d8f5039951f275c\r\n                        at ../src/libcore/option.rs:385\r\n  14:     0x563829abdaae - _<std..iter..Map<I, F> as std..iter..Iterator>::next::h6fa5be0e923cd3f4\r\n                        at ../src/libcore/iter/mod.rs:761\r\n  15:     0x563829ac02d2 - _<std..vec..Vec<T>>::extend_desugared::h4e090c0a240bba6d\r\n                        at ../src/libcollections/vec.rs:1417\r\n  16:     0x563829abd8c9 - _<std..vec..Vec<T> as std..iter..FromIterator<T>>::from_iter::hdba262cb1a9e1bb7\r\n                        at ../src/libcollections/vec.rs:1325\r\n  17:     0x563829abd417 - core::iter::iterator::Iterator::collect::hb180804f43673400\r\n                        at ../src/libcore/iter/iterator.rs:1208\r\n  18:     0x563829abd332 - systemd_manager::systemd_analyze::blame::heaaa57490d2b1465\r\n                        at src/systemd_analyze.rs:20\r\n  19:     0x563829adf577 - systemd_manager::systemd_gui::setup_systemd_analyze::hc664aa7befb6fb15\r\n                        at src/systemd_gui.rs:63\r\n  20:     0x563829abacf9 - systemd_manager::systemd_gui::launch::hec754e8cc76f2b1b\r\n                        at src/systemd_gui.rs:144\r\n  21:     0x563829aba1b8 - systemd_manager::main::h22a01905651f008f\r\n                        at src/main.rs:8\r\n  22:     0x563829b2afa4 - std::sys_common::unwind::try::try_fn::h04c0c89e4add6cc4\r\n  23:     0x563829b26a8b - __rust_try\r\n  24:     0x563829b2a9eb - std::rt::lang_start::h61f4934e780b4dfc\r\n  25:     0x563829abd0b9 - main\r\n  26:     0x7fc5adbe3740 - __libc_start_main\r\n  27:     0x563829aba0a8 - _start\r\n  28:                0x0 - <unknown>\r\nerror: Process didn't exit successfully: `target/debug/systemd-manager` (exit code: 101)\r\n```"},"comment":{"url":"https://api.github.com/repos/mmstick/systemd-manager/issues/comments/219779043","html_url":"https://github.com/mmstick/systemd-manager/issues/6#issuecomment-219779043","issue_url":"https://api.github.com/repos/mmstick/systemd-manager/issues/6","id":219779043,"user":{"login":"mmstick","id":4143535,"avatar_url":"https://avatars.githubusercontent.com/u/4143535?v=3","gravatar_id":"","url":"https://api.github.com/users/mmstick","html_url":"https://github.com/mmstick","followers_url":"https://api.github.com/users/mmstick/followers","following_url":"https://api.github.com/users/mmstick/following{/other_user}","gists_url":"https://api.github.com/users/mmstick/gists{/gist_id}","starred_url":"https://api.github.com/users/mmstick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmstick/subscriptions","organizations_url":"https://api.github.com/users/mmstick/orgs","repos_url":"https://api.github.com/users/mmstick/repos","events_url":"https://api.github.com/users/mmstick/events{/privacy}","received_events_url":"https://api.github.com/users/mmstick/received_events","type":"User","site_admin":false},"created_at":"2016-05-17T16:44:36Z","updated_at":"2016-05-17T16:44:36Z","body":"I have pushed a fix and used your information as input for unit tests in the `analyze.rs` source code file, therefore you should have accurate values now. If it's fixed for you, you can close the issue.\r\n\r\nI think it's odd that the systemd maintainers decided to use decimals for seconds if they are already going to split time into multiple units once the unit gets to minutes. If it were my choice, I'd make it consistent and also write it out as \"9s 334ms\" rather than \"9.334s\".\r\n\r\nIn any case, the new patch will be able to handle the current setup and if they ever implement \"3min 9s 334ms\" then that will work too. The fix is to collect each of the whitespace-delimited values into a single `Vec`, `pop()` the last value as the service, and then `fold()` across the original `Vec` to collect the time."}}