Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1b5ea18

Browse files
add rust lang
1 parent 99f921e commit 1b5ea18

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

‎lib/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const DEFAULT_CONFIG = {
2525
'python',
2626
'python3',
2727
'ruby',
28+
'rust',
2829
'scala',
2930
'swift'
3031
],

‎lib/helper.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const LANGS = [
4242
{lang: 'python', ext: '.py', style: '#'},
4343
{lang: 'python3', ext: '.py', style: '#'},
4444
{lang: 'ruby', ext: '.rb', style: '#'},
45+
{lang: 'rust', ext: '.rs', style: 'c'},
4546
{lang: 'scala', ext: '.scala', style: 'c'},
4647
{lang: 'swift', ext: '.swift', style: 'c'}
4748
];

‎test/test_helper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ describe('helper', function() {
133133
assert.equal(h.langToExt('ruby'), '.rb');
134134
assert.equal(h.langToExt('scala'), '.scala');
135135
assert.equal(h.langToExt('swift'), '.swift');
136-
assert.equal(h.langToExt('rust'), '.raw');
136+
assert.equal(h.langToExt('rust'), '.rs');
137137
});
138138
}); // #langToExt
139139

@@ -152,6 +152,7 @@ describe('helper', function() {
152152
assert.equal(h.extToLang('~/leetcode/file.swift'), 'swift');
153153
assert.equal(h.extToLang('~/leetcode/../file.sql'), 'mysql');
154154
assert.equal(h.extToLang('/home/skygragon/file.dat'), 'unknown');
155+
assert.equal(h.extToLang('~/leetcode/file.rs'), 'rust');
155156
});
156157
}); // #extToLang
157158

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /