Check network connectivity.
(dc: &mut DoctorCounters)
| 695 | |
| 696 | /// Check network connectivity. |
| 697 | fn check_network(dc: &mut DoctorCounters) { |
| 698 | eprintln!("\n\x1b[1mNetwork\x1b[0m"); |
| 699 | if let Some(total) = crate::cloud::fetch_worldwide_total() { |
| 700 | dc.pass(&format!( |
| 701 | "Worldwide counter reachable (total: {})", |
| 702 | format_token_count(total) |
| 703 | )); |
| 704 | } else { |
| 705 | dc.warn("Worldwide counter unreachable (offline or timeout)"); |
| 706 | } |
| 707 | if crate::cloud::fetch_latest_version().is_some() { |
| 708 | dc.pass("GitHub releases API reachable"); |
| 709 | } else { |
| 710 | dc.warn("GitHub releases API unreachable (offline or timeout)"); |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | /// Print final summary. |
| 715 | fn print_summary(dc: &DoctorCounters) { |
no test coverage detected