• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubybathyscaphegamewindowspythonphpguic翻訳omegattwitterframeworkbtronarduinovb.net計画中(planning stage)directxpreviewertestゲームエンジンdom

Commit MetaInfo

Revision886009e95abf9c929745c4895f44a9f7681897f4 (tree)
Time2020-02-14 19:46:30
AuthorAlexander Larin
CommiterAlexander Larin

Log Message

Run cargo fmt

Change Summary

Incremental Difference

diff -r 68d84481e066 -r 886009e95abf src/main.rs
--- a/src/main.rs Fri Feb 14 12:49:30 2020 +0300
+++ b/src/main.rs Fri Feb 14 13:46:30 2020 +0300
@@ -4,8 +4,8 @@
44 extern crate tokio_core;
55
66 use futures::{Future, Stream};
7+use telegram_bot::types::refs::UserId;
78 use telegram_bot::*;
8-use telegram_bot::types::refs::UserId;
99 use tokio_core::reactor::Core;
1010
1111 mod logger;
@@ -59,14 +59,12 @@
5959 }
6060
6161 fn is_building_just_now() -> bool {
62- use sysinfo::{RefreshKind, System, SystemExt, ProcessExt};
62+ use sysinfo::{ProcessExt, RefreshKind, System, SystemExt};
6363
6464 let sys = System::new_with_specifics(RefreshKind::new().with_processes());
6565
66- for (_, proc) in sys.get_processes()
67- {
68- if proc.name() == "qtcreator_ctrlc_stub.exe" || proc.name() == "node.exe"
69- {
66+ for (_, proc) in sys.get_processes() {
67+ if proc.name() == "qtcreator_ctrlc_stub.exe" || proc.name() == "node.exe" {
7068 return true;
7169 }
7270 }
@@ -74,20 +72,17 @@
7472 false
7573 }
7674
77-fn try_get_creator_id() -> Option<UserId>
78-{
75+fn try_get_creator_id() -> Option<UserId> {
7976 // TODO: write it by and_then
8077 let res = std::env::var("CREATOR_ID");
81- match res
82- {
83- Ok(s) => if let Ok(id) = s.parse()
84- {
78+ match res {
79+ Ok(s) => {
80+ if let Ok(id) = s.parse() {
8581 Some(UserId::new(id))
82+ } else {
83+ None
8684 }
87- else
88- {
89- None
90- },
85+ }
9186 Err(_) => None,
9287 }
9388 }
@@ -105,8 +100,7 @@
105100
106101 let creator_id = try_get_creator_id();
107102
108- if let Some(creator_id) = creator_id
109- {
103+ if let Some(creator_id) = creator_id {
110104 let user = telegram_bot::chat::User {
111105 first_name: "".to_string(),
112106 id: creator_id,