File tree 6 files changed +16
-51
lines changed
6 files changed +16
-51
lines changed Original file line number Diff line number Diff line change 63
63
runs-on : ubuntu-latest
64
64
steps :
65
65
- uses : actions/checkout@v4
66
- - uses : dtolnay/rust-toolchain@master
67
- with :
68
- toolchain : nightly-2025-02-01
69
- components : rustfmt
70
66
- uses : dtolnay/rust-toolchain@stable
71
67
- uses : Swatinem/rust-cache@v2
72
- - run : cargo +nightly-2025-02-01 fmt --check
68
+ - run : cargo fmt --check
73
69
- run : cargo lint
74
70
env :
75
71
# Make sure CI fails on all warnings, including Clippy lints.
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " cairo-language-server"
3
3
version = " 2.10.0"
4
- edition = " 2021 "
4
+ edition = " 2024 "
5
5
6
6
authors = [" Software Mansion <contact@swmansion.com>" , " StarkWare <info@starkware.co>" ]
7
7
description = " The Cairo Language Server"
Original file line number Diff line number Diff line change 1
- edition = " 2021"
2
- newline_style = " unix"
3
- use_field_init_shorthand = true
4
- use_small_heuristics = " Max"
5
- use_try_shorthand = true
6
- max_width = 100
7
-
8
- # Unstable features below
9
- unstable_features = true
10
1
style_edition = " 2024"
11
- comment_width = 100
12
- format_code_in_doc_comments = true
13
- format_macro_bodies = true
14
- format_macro_matchers = true
15
- format_strings = true
16
- imports_granularity = " Module"
17
- group_imports = " StdExternalCrate"
18
- normalize_comments = true
19
- normalize_doc_attributes = true
20
- wrap_comments = true
21
-
22
- # To use these settings in vscode, add the following line to your settings:
23
- # "rust-analyzer.rustfmt.overrideCommand": [
24
- # "rustup",
25
- # "run",
26
- # "nightly-2025-02-01",
27
- # "--",
28
- # "rustfmt",
29
- # "--edition",
30
- # "2021",
31
- # "--"
32
- # ]
33
- # and run "rustup toolchain install nightly-2025-02-01".
2
+ use_small_heuristics = " Max"
Original file line number Diff line number Diff line change @@ -14,10 +14,12 @@ use crate::lang::db::AnalysisDatabase;
14
14
/// Safety: This function MUST only be invoked with an object that is of type
15
15
/// [AnalysisDatabase]. Using it with any other type leads to undefined behavior.
16
16
pub ( super ) unsafe fn unsafe_downcast_ref ( db : & dyn SyntaxGroup ) -> & AnalysisDatabase {
17
- // Replicated logic from `impl dyn Any downcast_ref_unchecked()`.
18
- // This approach works as long as `impl dyn Any downcast_ref_unchecked()` implementation is
19
- // unchanged and the caller can ensure that `db` is truly an instance of AnalysisDatabase.
20
- & * ( db as * const dyn SyntaxGroup as * const AnalysisDatabase )
17
+ unsafe {
18
+ // Replicated logic from `impl dyn Any downcast_ref_unchecked()`.
19
+ // This approach works as long as `impl dyn Any downcast_ref_unchecked()` implementation is
20
+ // unchanged and the caller can ensure that `db` is truly an instance of AnalysisDatabase.
21
+ & * ( db as * const dyn SyntaxGroup as * const AnalysisDatabase )
22
+ }
21
23
}
22
24
23
25
#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -79,19 +79,17 @@ impl Crate {
79
79
inject_virtual_wrapper_lib ( db, crate_id, file_stems) ;
80
80
}
81
81
82
- let plugins = self . builtin_plugins
82
+ let plugins = self
83
+ . builtin_plugins
83
84
. iter ( )
84
85
. map ( BuiltinPlugin :: suite)
85
86
. chain ( tricks ( ) ) // All crates should receive Tricks.
86
87
. chain ( enable_linter. then ( cairo_lint_plugin_suite) )
87
88
. chain ( proc_macro_plugin_suite)
88
- . fold (
89
- get_default_plugin_suite ( ) ,
90
- |mut acc, suite| {
91
- acc. add ( suite) ;
92
- acc
93
- } ,
94
- ) ;
89
+ . fold ( get_default_plugin_suite ( ) , |mut acc, suite| {
90
+ acc. add ( suite) ;
91
+ acc
92
+ } ) ;
95
93
96
94
let interned_plugins = db. intern_plugin_suite ( plugins) ;
97
95
db. set_override_crate_plugins_from_suite ( crate_id, interned_plugins) ;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ impl MemberConfig {
23
23
}
24
24
25
25
fn merge_serde_json_value ( a : & mut Value , b : & Value ) {
26
- if let ( Value :: Object ( ref mut a_map) , Value :: Object ( ref b_map) ) = ( a, b) {
26
+ if let ( Value :: Object ( a_map) , Value :: Object ( b_map) ) = ( a, b) {
27
27
for ( b_key, b_val) in b_map {
28
28
if let Some ( a_val) = a_map. get_mut ( b_key) {
29
29
if a_val. is_object ( ) && b_val. is_object ( ) {
You can’t perform that action at this time.
0 commit comments