Skip to content

Commit 2c95c85

Browse files
committed
capital C core
1 parent bd4667a commit 2c95c85

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

rust/src/ta_func/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,18 @@
3737
*/
3838

3939
// Rust-specific types and enumerations
40+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
4041
pub enum RetCode {
4142
Success,
4243
BadParam,
4344
OutOfRangeStartIndex,
4445
OutOfRangeEndIndex,
4546
AllocErr,
46-
InternalError
47+
InternalError,
4748
}
4849

4950
// Core struct definition
50-
pub struct core {}
51+
pub struct Core {}
5152

5253
pub use self::mult::*;
5354
pub mod mult;

src/ta_abstract/templates/ta_func_mod.rs.template

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,18 @@
3737
*/
3838

3939
// Rust-specific types and enumerations
40+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
4041
pub enum RetCode {
4142
Success,
4243
BadParam,
4344
OutOfRangeStartIndex,
4445
OutOfRangeEndIndex,
4546
AllocErr,
46-
InternalError
47+
InternalError,
4748
}
4849

4950
// Core struct definition
50-
pub struct core {}
51+
pub struct Core {}
5152

5253
%%%GENCODE%%%
5354

src/ta_abstract/templates/ta_x.rs.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
* in ta-lib\src\ta_func
4040
*/
4141

42+
// Import types from parent module
43+
use super::{RetCode, Core};
44+
4245
%%%GENCODE%%%
4346

4447
/***************/

src/tools/gen_code/gen_code.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3141,7 +3141,7 @@ static void doFuncFile( const TA_FuncInfo *funcInfo )
31413141
print( gOutFunc_C->file, "#if defined( _MANAGED )\n" );
31423142
print( gOutFunc_C->file, "}}} // Close namespace TicTacTec.TA.Lib\n" );
31433143
print( gOutFunc_C->file, "#elif defined( _RUST )\n" );
3144-
print( gOutFunc_C->file, "} // Close impl core\n" );
3144+
print( gOutFunc_C->file, "} // Close impl Core\n" );
31453145
print( gOutFunc_C->file, "#endif\n" );
31463146

31473147
fileClose( gOutFunc_C );
@@ -3383,7 +3383,7 @@ static void writeFuncFile( const TA_FuncInfo *funcInfo )
33833383
print( out, "#elif defined( _RUST )\n" );
33843384
print( out, " #include \"ta_defs.h\"\n" );
33853385
print( out, " #define TA_INTERNAL_ERROR(Id) (RetCode.InternalError)\n" );
3386-
print( out, " impl core {\n" );
3386+
print( out, " impl Core {\n" );
33873387
print( out, "#else\n" );
33883388
print( out, " #include <string.h>\n" );
33893389
print( out, " #include <math.h>\n" );

0 commit comments

Comments
 (0)