diff options
Diffstat (limited to 'lib/compilers/rust.ts')
-rw-r--r-- | lib/compilers/rust.ts | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/lib/compilers/rust.ts b/lib/compilers/rust.ts index 89b52533d..f1d0d3a89 100644 --- a/lib/compilers/rust.ts +++ b/lib/compilers/rust.ts @@ -35,6 +35,7 @@ import {RustParser} from './argument-parsers'; export class RustCompiler extends BaseCompiler { linker: string; + static get key() { return 'rust'; } @@ -69,24 +70,19 @@ export class RustCompiler extends BaseCompiler { override getIncludeArguments(libraries) { const includeFlag = '--extern'; - return _.flatten( - _.map(libraries, selectedLib => { - const foundVersion = this.findLibVersion(selectedLib); - if (!foundVersion) return false; - if (!foundVersion.name) return false; - const list: string[] = []; - const lowercaseLibName = foundVersion.name.replaceAll('-', '_'); - for (const rlib of foundVersion.path) { - list.push( - includeFlag, - `${lowercaseLibName}=${foundVersion.name}/build/debug/${rlib}`, - '-L', - `dependency=${foundVersion.name}/build/debug/deps`, - ); - } - return list; - }), - ); + return libraries.flatMap(selectedLib => { + const foundVersion = this.findLibVersion(selectedLib); + if (!foundVersion || !foundVersion.name) return []; + const lowercaseLibName = foundVersion.name.replaceAll('-', '_'); + return foundVersion.path.flatMap(rlib => { + return [ + includeFlag, + `${lowercaseLibName}=${foundVersion.name}/build/debug/${rlib}`, + '-L', + `dependency=${foundVersion.name}/build/debug/deps`, + ]; + }); + }); } override orderArguments( |