Skip to content

Commit 636c047

Browse files
committed
Rust: Use final class.
1 parent d828941 commit 636c047

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed

rust/ql/lib/codeql/rust/Concepts.qll

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,7 @@ private import codeql.threatmodels.ThreatModels
1313
* Extend this class to refine existing API models. If you want to model new APIs,
1414
* extend `ThreatModelSource::Range` instead.
1515
*/
16-
class ThreatModelSource extends DataFlow::Node instanceof ThreatModelSource::Range {
17-
/**
18-
* Gets a string that represents the source kind with respect to threat modeling.
19-
*
20-
* See
21-
* - https://github.com/github/codeql/blob/main/docs/codeql/reusables/threat-model-description.rst
22-
* - https://github.com/github/codeql/blob/main/shared/threat-models/ext/threat-model-grouping.model.yml
23-
*/
24-
string getThreatModel() { result = super.getThreatModel() }
25-
26-
/**
27-
* Gets a string that describes the type of this threat-model source.
28-
*/
29-
string getSourceType() { result = super.getSourceType() }
30-
}
16+
final class ThreatModelSource = ThreatModelSource::Range;
3117

3218
/**
3319
* Provides a class for modeling new sources for specific threat-models.
@@ -67,12 +53,7 @@ class ActiveThreatModelSource extends ThreatModelSource {
6753
* Extend this class to refine existing API models. If you want to model new APIs,
6854
* extend `SqlConstruction::Range` instead.
6955
*/
70-
class SqlConstruction extends DataFlow::Node instanceof SqlConstruction::Range {
71-
/**
72-
* Gets the argument that specifies the SQL statements to be constructed.
73-
*/
74-
DataFlow::Node getSql() { result = super.getSql() }
75-
}
56+
final class SqlConstruction = SqlConstruction::Range;
7657

7758
/**
7859
* Provides a class for modeling new SQL execution APIs.
@@ -98,12 +79,7 @@ module SqlConstruction {
9879
* Extend this class to refine existing API models. If you want to model new APIs,
9980
* extend `SqlExecution::Range` instead.
10081
*/
101-
class SqlExecution extends DataFlow::Node instanceof SqlExecution::Range {
102-
/**
103-
* Gets the argument that specifies the SQL statements to be executed.
104-
*/
105-
DataFlow::Node getSql() { result = super.getSql() }
106-
}
82+
final class SqlExecution = SqlExecution::Range;
10783

10884
/**
10985
* Provides a class for modeling new SQL execution APIs.
@@ -123,7 +99,7 @@ module SqlExecution {
12399
/**
124100
* A data-flow node that performs SQL sanitization.
125101
*/
126-
class SqlSanitization extends DataFlow::Node instanceof SqlSanitization::Range { }
102+
final class SqlSanitization = SqlSanitization::Range;
127103

128104
/**
129105
* Provides a class for modeling new SQL sanitization APIs.

0 commit comments

Comments
 (0)