File tree 1 file changed +13
-14
lines changed
crates/rust-analyzer/src/handlers
1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -2039,20 +2039,19 @@ fn to_url(path: VfsPath) -> Option<Url> {
2039
2039
}
2040
2040
2041
2041
fn resource_ops_supported ( config : & Config , kind : ResourceOperationKind ) -> anyhow:: Result < ( ) > {
2042
- let ctn = config
2043
- . caps ( )
2044
- . workspace
2045
- . as_ref ( )
2046
- . unwrap ( )
2047
- . workspace_edit
2048
- . as_ref ( )
2049
- . unwrap ( )
2050
- . resource_operations
2051
- . as_ref ( )
2052
- . unwrap ( )
2053
- . contains ( & kind) ;
2054
-
2055
- if !ctn {
2042
+ #[ rustfmt:: skip]
2043
+ let resops = ( || {
2044
+ config
2045
+ . caps ( )
2046
+ . workspace
2047
+ . as_ref ( ) ?
2048
+ . workspace_edit
2049
+ . as_ref ( ) ?
2050
+ . resource_operations
2051
+ . as_ref ( )
2052
+ } ) ( ) ;
2053
+
2054
+ if !matches ! ( resops, Some ( resops) if resops. contains( & kind) ) {
2056
2055
return Err ( LspError :: new (
2057
2056
ErrorCode :: RequestFailed as i32 ,
2058
2057
format ! (
You can’t perform that action at this time.
0 commit comments