File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99// while all the functions included are used only with `custom-api` and `custom-api-json` features.
1010#![ cfg_attr( not( feature = "api-custom" ) , allow( unused_variables, dead_code) ) ]
1111
12+ use crate :: GodotVersion ;
13+
14+ #[ cfg( feature = "api-custom" ) ]
1215use std:: error:: Error ;
16+ #[ cfg( feature = "api-custom" ) ]
1317use std:: str:: FromStr ;
1418
19+ #[ cfg( feature = "api-custom" ) ]
1520use regex:: { Captures , Regex } ;
1621
17- use crate :: GodotVersion ;
18-
22+ #[ cfg( feature = "api-custom" ) ]
1923pub fn parse_godot_version ( version_str : & str ) -> Result < GodotVersion , Box < dyn Error > > {
2024 // Format of the string emitted by `godot --version`:
2125 // https://github.com/godot-rust/gdext/issues/118#issuecomment-1465748123
@@ -71,6 +75,7 @@ pub(crate) fn validate_godot_version(godot_version: &GodotVersion) {
7175}
7276
7377/// Extracts and parses a named capture group from a regex match.
78+ #[ cfg( feature = "api-custom" ) ]
7479fn cap < T : FromStr > ( caps : & Captures , key : & str ) -> Result < Option < T > , Box < dyn Error > > {
7580 caps. name ( key)
7681 . map ( |m| m. as_str ( ) . parse ( ) )
You can’t perform that action at this time.
0 commit comments