Skip to content

Commit fc2c656

Browse files
committed
More succinct config parsing
1 parent aba5f0f commit fc2c656

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

autoload/rust.vim

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -376,16 +376,8 @@ endfunction
376376
function! rust#Play(count, line1, line2, ...) abort
377377
redraw
378378

379-
if !exists('g:rust_playpen_url')
380-
let l:rust_playpen_url = 'https://play.rust-lang.org/'
381-
else
382-
let l:rust_playpen_url = g:rust_playpen_url
383-
endif
384-
if !exists('g:rust_shortener_url')
385-
let l:rust_shortener_url = 'https://is.gd/'
386-
else
387-
let l:rust_shortener_url = g:rust_shortener_url
388-
endif
379+
let l:rust_playpen_url = get(g:, 'rust_playpen_url', 'https://play.rust-lang.org/')
380+
let l:rust_shortener_url = get(g:, 'rust_shortener_url', 'https://is.gd/')
389381

390382
if !s:has_webapi()
391383
echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None

0 commit comments

Comments
 (0)