comparison src/main.rs @ 16:478cf2a7d577

Reformat with rustfmt.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 26 Aug 2021 19:45:30 +0200
parents adab13145994
children 0bce7fe96937
comparison
equal deleted inserted replaced
15:d103f7cca0bd 16:478cf2a7d577
15 // along with this program. If not, see <https://www.gnu.org/licenses/>. 15 // along with this program. If not, see <https://www.gnu.org/licenses/>.
16 16
17 #[cfg(feature = "gui")] 17 #[cfg(feature = "gui")]
18 mod gtk; 18 mod gtk;
19 mod server; 19 mod server;
20 mod state;
20 mod uinput; 21 mod uinput;
21 mod state;
22 22
23 use std::env::args; 23 use std::env::args;
24 24
25 const MAX_X: i32 = 69920; 25 const MAX_X: i32 = 69920;
26 const MAX_Y: i32 = 39980; 26 const MAX_Y: i32 = 39980;
38 let mut args: Vec<_> = args().collect(); 38 let mut args: Vec<_> = args().collect();
39 let ui = match if args.len() > 1 { 39 let ui = match if args.len() > 1 {
40 args.remove(1) 40 args.remove(1)
41 } else { 41 } else {
42 String::from("gui") 42 String::from("gui")
43 }.as_str() { 43 }
44 .as_str()
45 {
44 "gui" => Ui::Gtk, 46 "gui" => Ui::Gtk,
45 "server" => Ui::Server, 47 "server" => Ui::Server,
46 name => { 48 name => {
47 eprintln!("Wrong UI “{}”, expected gui or server.", name); 49 eprintln!("Wrong UI “{}”, expected gui or server.", name);
48 std::process::exit(2); 50 std::process::exit(2);