File tree Expand file tree Collapse file tree
packages/typespec-rust/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ import { Use } from './use.js';
88import * as rust from '../codemodel/index.js' ;
99import * as utils from '../utils/utils.js' ;
1010
11+ /** the key phrase used in the generated code header */
12+ export const generatedCodeKeyPhrase = 'Rust Code Generator' ;
13+
1114const headerText = `// Copyright (c) Microsoft Corporation. All rights reserved.
1215// Licensed under the MIT License.
1316//
14- // Code generated by Microsoft (R) Rust Code Generator .` ;
17+ // Code generated by Microsoft (R) ${ generatedCodeKeyPhrase } .` ;
1518
1619export const AnnotationNonExhaustive = '#[non_exhaustive]\n' ;
1720
Original file line number Diff line number Diff line change 77
88import { CodeGenerator } from './codegen/codeGenerator.js' ;
99import { CodegenError } from './codegen/errors.js' ;
10+ import { generatedCodeKeyPhrase } from './codegen/helpers.js' ;
1011import { Adapter , AdapterError , ExternalError } from './tcgcadapter/adapter.js' ;
1112import { reportDiagnostic , RustEmitterOptions } from './lib.js' ;
1213import { execSync } from 'child_process' ;
@@ -188,5 +189,5 @@ function shouldRmDir(dirName: string): boolean {
188189 return false ;
189190 }
190191 const content = fs . readFileSync ( modRs , { encoding : 'utf-8' } ) ;
191- return content . match ( / R u s t C o d e G e n e r a t o r / ) !== null ;
192+ return content . match ( generatedCodeKeyPhrase ) !== null ;
192193}
You can’t perform that action at this time.
0 commit comments