This repository was archived by the owner on Dec 29, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -51,21 +51,19 @@ type Span = span::Span<span::ZeroIndexed>;
51
51
pub fn main ( ) {
52
52
env_logger:: init ( ) . unwrap ( ) ;
53
53
54
- let args: Vec < String > = :: std:: env:: args ( ) . collect ( ) ;
55
- if args[ 1 ] == "--version" || args[ 1 ] == "-V" {
56
- println ! ( "rls {}" , version( ) ) ;
54
+ if let Some ( first_arg) = :: std:: env:: args ( ) . skip ( 1 ) . next ( ) {
55
+ match first_arg. as_str ( ) {
56
+ "--version" | "-V" => println ! ( "rls {}" , version( ) ) ,
57
+ _ => cmd:: run ( ) ,
58
+ }
57
59
return ;
58
60
}
59
61
60
- if args. len ( ) > 1 {
61
- cmd:: run ( ) ;
62
- } else {
63
- let analysis = Arc :: new ( analysis:: AnalysisHost :: new ( analysis:: Target :: Debug ) ) ;
64
- let vfs = Arc :: new ( vfs:: Vfs :: new ( ) ) ;
65
- let build_queue = Arc :: new ( build:: BuildQueue :: new ( vfs. clone ( ) ) ) ;
62
+ let analysis = Arc :: new ( analysis:: AnalysisHost :: new ( analysis:: Target :: Debug ) ) ;
63
+ let vfs = Arc :: new ( vfs:: Vfs :: new ( ) ) ;
64
+ let build_queue = Arc :: new ( build:: BuildQueue :: new ( vfs. clone ( ) ) ) ;
66
65
67
- server:: run_server ( analysis, vfs, build_queue) ;
68
- }
66
+ server:: run_server ( analysis, vfs, build_queue) ;
69
67
}
70
68
71
69
fn version ( ) -> & ' static str {
You can’t perform that action at this time.
0 commit comments