Skip to content

Commit

Permalink
Merge pull request #2394 from fzyzcjy/feat/12632
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy authored Nov 5, 2024
2 parents d605d25 + bdb1e74 commit 8574bf8
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 43 deletions.
7 changes: 2 additions & 5 deletions frb_codegen/src/library/commands/fvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ use crate::library::commands::command_runner::call_shell;
use std::path::Path;

pub(crate) fn command_arg_maybe_fvm(pwd: Option<&Path>) -> Option<String> {
if should_use_fvm(pwd) {
Some("fvm".to_owned())
} else {
None
}
should_use_fvm(pwd).then(|| "fvm".to_owned())
}

fn should_use_fvm(pwd: Option<&Path>) -> bool {
Expand Down Expand Up @@ -36,6 +32,7 @@ fn has_fvmrc(pwd: &Path) -> bool {
}
}

#[allow(clippy::vec_init_then_push)]
fn has_fvm_installation() -> bool {
command_run!(call_shell[None, None], "fvm", "--version")
.map_or(false, |res| res.status.success())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 1,
"impl_mode": "Normal",
"initializer": false,
Expand Down Expand Up @@ -219,7 +218,11 @@
}
],
"mode": "Normal",
"name": "crate::api/func_enum_bool",
"name": {
"dart_style": null,
"rust_style": "func_enum_bool"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand All @@ -242,7 +245,6 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 2,
"impl_mode": "Normal",
"initializer": false,
Expand Down Expand Up @@ -295,7 +297,11 @@
}
],
"mode": "Normal",
"name": "crate::api/func_enum_string",
"name": {
"dart_style": null,
"rust_style": "func_enum_string"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand All @@ -318,7 +324,6 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 3,
"impl_mode": "Normal",
"initializer": false,
Expand Down Expand Up @@ -371,7 +376,11 @@
}
],
"mode": "Normal",
"name": "crate::api/func_struct_bool",
"name": {
"dart_style": null,
"rust_style": "func_struct_bool"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand All @@ -394,7 +403,6 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 4,
"impl_mode": "Normal",
"initializer": false,
Expand Down Expand Up @@ -447,7 +455,11 @@
}
],
"mode": "Normal",
"name": "crate::api/func_struct_string",
"name": {
"dart_style": null,
"rust_style": "func_struct_string"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand All @@ -470,7 +482,6 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 5,
"impl_mode": "Normal",
"initializer": false,
Expand Down Expand Up @@ -523,7 +534,11 @@
}
],
"mode": "Normal",
"name": "crate::api/func_struct_string_repeated",
"name": {
"dart_style": null,
"rust_style": "func_struct_string_repeated"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 1,
"impl_mode": "Normal",
"initializer": false,
Expand Down Expand Up @@ -91,7 +90,11 @@
}
],
"mode": "Normal",
"name": "crate::api/my_enum_example_instance_method",
"name": {
"dart_style": null,
"rust_style": "my_enum_example_instance_method"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand Down Expand Up @@ -135,13 +138,16 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 2,
"impl_mode": "Normal",
"initializer": false,
"inputs": [],
"mode": "Normal",
"name": "crate::api/my_enum_example_static_method",
"name": {
"dart_style": null,
"rust_style": "my_enum_example_static_method"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand Down Expand Up @@ -185,7 +191,6 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 3,
"impl_mode": "Normal",
"initializer": false,
Expand Down Expand Up @@ -224,7 +229,11 @@
}
],
"mode": "Normal",
"name": "crate::api/my_struct_example_instance_method",
"name": {
"dart_style": null,
"rust_style": "my_struct_example_instance_method"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand Down Expand Up @@ -263,13 +272,16 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 4,
"impl_mode": "Normal",
"initializer": false,
"inputs": [],
"mode": "Normal",
"name": "crate::api/my_struct_example_static_method",
"name": {
"dart_style": null,
"rust_style": "my_struct_example_static_method"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 1,
"impl_mode": "Normal",
"initializer": false,
"inputs": [],
"mode": "Normal",
"name": "crate::api_one/func_one",
"name": {
"dart_style": null,
"rust_style": "func_one"
},
"namespace": "crate::api_one",
"output": {
"error": null,
"normal": {
Expand All @@ -49,13 +52,16 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 2,
"impl_mode": "Normal",
"initializer": false,
"inputs": [],
"mode": "Normal",
"name": "crate::api_two/func_two",
"name": {
"dart_style": null,
"rust_style": "func_two"
},
"namespace": "crate::api_two",
"output": {
"error": null,
"normal": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 1,
"impl_mode": "Normal",
"initializer": false,
Expand Down Expand Up @@ -73,7 +72,11 @@
}
],
"mode": "Normal",
"name": "crate::api/func_1",
"name": {
"dart_style": null,
"rust_style": "func_1"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand All @@ -96,13 +99,16 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 2,
"impl_mode": "Normal",
"initializer": false,
"inputs": [],
"mode": "Normal",
"name": "crate::api/func_anyhow_result",
"name": {
"dart_style": null,
"rust_style": "func_anyhow_result"
},
"namespace": "crate::api",
"output": {
"error": {
"data": "String",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 1,
"impl_mode": "Normal",
"initializer": false,
Expand Down Expand Up @@ -73,7 +72,11 @@
}
],
"mode": "Normal",
"name": "crate::api/func_1",
"name": {
"dart_style": null,
"rust_style": "func_1"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand All @@ -96,13 +99,16 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 2,
"impl_mode": "Normal",
"initializer": false,
"inputs": [],
"mode": "Normal",
"name": "crate::api/func_anyhow_result",
"name": {
"dart_style": null,
"rust_style": "func_anyhow_result"
},
"namespace": "crate::api",
"output": {
"error": {
"data": "String",
Expand All @@ -129,13 +135,16 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 3,
"impl_mode": "Normal",
"initializer": false,
"inputs": [],
"mode": "Normal",
"name": "crate::api/func_result",
"name": {
"dart_style": null,
"rust_style": "func_result"
},
"namespace": "crate::api",
"output": {
"error": {
"data": "String",
Expand All @@ -162,13 +171,16 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 4,
"impl_mode": "Normal",
"initializer": false,
"inputs": [],
"mode": "Normal",
"name": "crate::api/func_std_result_result",
"name": {
"dart_style": null,
"rust_style": "func_std_result_result"
},
"namespace": "crate::api",
"output": {
"error": {
"data": "String",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
"rust2dart": "Dco"
},
"comments": [],
"dart_name": null,
"id": 1,
"impl_mode": "Normal",
"initializer": false,
"inputs": [],
"mode": "Normal",
"name": "crate::api/first_function",
"name": {
"dart_style": null,
"rust_style": "first_function"
},
"namespace": "crate::api",
"output": {
"error": null,
"normal": {
Expand Down
Loading

0 comments on commit 8574bf8

Please sign in to comment.