Skip to content

Commit ab0607b

Browse files
committed
Fix misc typos and add typos to rust CI
1 parent 449809f commit ab0607b

File tree

11 files changed

+41
-30
lines changed

11 files changed

+41
-30
lines changed

.github/workflows/rust.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,14 @@ jobs:
4141
uses: actions-rust-lang/rustfmt@v1
4242
with:
4343
manifest-path: ./rust/Cargo.toml
44+
45+
# Check spelling with typos
46+
spelling:
47+
name: typos
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
- name: Typo Check
52+
uses: crate-ci/typos@v1.29.4
53+
with:
54+
files: ./rust

plugins/pdb-ng/src/symbol_parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use binaryninja::confidence::ConfMergable;
15+
use binaryninja::confidence::ConfMergeable;
1616
use std::collections::{BTreeMap, HashMap, HashSet};
1717
use std::mem;
1818
use std::sync::OnceLock;

rust/src/binaryview.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -844,13 +844,13 @@ pub trait BinaryViewExt: BinaryViewBase {
844844
// TODO: Replace with BulkModify guard.
845845
/// Start adding segments in bulk. Useful for adding large numbers of segments.
846846
///
847-
/// After calling this any call to [BinaryViewExt::add_segment] will be uncommited until a call to
847+
/// After calling this any call to [BinaryViewExt::add_segment] will be uncommitted until a call to
848848
/// [BinaryViewExt::end_bulk_add_segments]
849849
///
850-
/// If you wish to discard the uncommited segments you can call [BinaryViewExt::cancel_bulk_add_segments].
850+
/// If you wish to discard the uncommitted segments you can call [BinaryViewExt::cancel_bulk_add_segments].
851851
///
852852
/// NOTE: This **must** be paired with a later call to [BinaryViewExt::end_bulk_add_segments] or
853-
/// [BinaryViewExt::cancel_bulk_add_segments], otherwise segments added after this call will stay uncommited.
853+
/// [BinaryViewExt::cancel_bulk_add_segments], otherwise segments added after this call will stay uncommitted.
854854
fn begin_bulk_add_segments(&self) {
855855
unsafe { BNBeginBulkAddSegments(self.as_ref().handle) }
856856
}

rust/src/confidence.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct Conf<T> {
2424
pub confidence: u8,
2525
}
2626

27-
pub trait ConfMergable<T, O> {
27+
pub trait ConfMergeable<T, O> {
2828
type Result;
2929
/// Merge two confidence types' values depending on whichever has higher confidence
3030
/// In the event of a tie, the LHS (caller's) value is used.
@@ -57,7 +57,7 @@ impl<T> Conf<T> {
5757
/// Returns best value or LHS on tie
5858
///
5959
/// `Conf<T>` + `Conf<T>` → `Conf<T>`
60-
impl<T> ConfMergable<T, Conf<T>> for Conf<T> {
60+
impl<T> ConfMergeable<T, Conf<T>> for Conf<T> {
6161
type Result = Conf<T>;
6262
fn merge(self, other: Conf<T>) -> Conf<T> {
6363
if other.confidence > self.confidence {
@@ -71,7 +71,7 @@ impl<T> ConfMergable<T, Conf<T>> for Conf<T> {
7171
/// Returns LHS if RHS is None
7272
///
7373
/// `Conf<T>` + `Option<Conf<T>>` → `Conf<T>`
74-
impl<T> ConfMergable<T, Option<Conf<T>>> for Conf<T> {
74+
impl<T> ConfMergeable<T, Option<Conf<T>>> for Conf<T> {
7575
type Result = Conf<T>;
7676
fn merge(self, other: Option<Conf<T>>) -> Conf<T> {
7777
match other {
@@ -84,7 +84,7 @@ impl<T> ConfMergable<T, Option<Conf<T>>> for Conf<T> {
8484
/// Returns RHS if LHS is None
8585
///
8686
/// `Option<Conf<T>>` + `Conf<T>` → `Conf<T>`
87-
impl<T> ConfMergable<T, Conf<T>> for Option<Conf<T>> {
87+
impl<T> ConfMergeable<T, Conf<T>> for Option<Conf<T>> {
8888
type Result = Conf<T>;
8989
fn merge(self, other: Conf<T>) -> Conf<T> {
9090
match self {
@@ -97,7 +97,7 @@ impl<T> ConfMergable<T, Conf<T>> for Option<Conf<T>> {
9797
/// Returns best non-None value or None
9898
///
9999
/// `Option<Conf<T>>` + `Option<Conf<T>>` → `Option<Conf<T>>`
100-
impl<T> ConfMergable<T, Option<Conf<T>>> for Option<Conf<T>> {
100+
impl<T> ConfMergeable<T, Option<Conf<T>>> for Option<Conf<T>> {
101101
type Result = Option<Conf<T>>;
102102
fn merge(self, other: Option<Conf<T>>) -> Option<Conf<T>> {
103103
match (self, other) {

rust/src/custombinaryview.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ impl<'a, T: CustomBinaryViewType> CustomViewBuilder<'a, T> {
430430
///
431431
/// The `BinaryView` argument passed to the constructor function is the object that is expected
432432
/// to be returned by the `AsRef<BinaryView>` implementation required by the `BinaryViewBase` trait.
433-
/// TODO FIXME welp this is broke going to need 2 init callbacks
433+
/// TODO FIXME whelp this is broke going to need 2 init callbacks
434434
pub fn create<V>(self, parent: &BinaryView, view_args: V::Args) -> Result<CustomView<'a>>
435435
where
436436
V: CustomBinaryView,
@@ -545,7 +545,7 @@ impl<'a, T: CustomBinaryViewType> CustomViewBuilder<'a, T> {
545545
// prohibited, so an API contract was violated in order to get here.
546546
//
547547
// if we're here, it's too late to do anything about it, though we can at least not
548-
// run the destructor on the custom view since that memory is unitialized.
548+
// run the destructor on the custom view since that memory is uninitialized.
549549
log::error!(
550550
"BinaryViewBase::freeObject called on partially initialized object! crash imminent!"
551551
);

rust/src/function.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ impl Function {
20142014
unsafe { Array::new(vars, count, ()) }
20152015
}
20162016

2017-
/// Merge one or more varibles in `sources` into the `target` variable. All
2017+
/// Merge one or more variables in `sources` into the `target` variable. All
20182018
/// variable accesses to the variables in `sources` will be rewritten to use `target`.
20192019
///
20202020
/// * `target` - target variable
@@ -2058,7 +2058,7 @@ impl Function {
20582058
}
20592059
}
20602060

2061-
/// Splits a varible at the definition site. The given `var` must be the
2061+
/// Splits a variable at the definition site. The given `var` must be the
20622062
/// variable unique to the definition and should be obtained by using
20632063
/// [crate::mlil::MediumLevelILInstruction::get_split_var_for_definition] at the definition site.
20642064
///
@@ -2081,7 +2081,7 @@ impl Function {
20812081
unsafe { BNSplitVariable(self.handle, &raw_var) }
20822082
}
20832083

2084-
/// Undoes varible splitting performed with [Function::split_variable]. The given `var`
2084+
/// Undoes variable splitting performed with [Function::split_variable]. The given `var`
20852085
/// must be the variable unique to the definition and should be obtained by using
20862086
/// [crate::mlil::MediumLevelILInstruction::get_split_var_for_definition] at the definition site.
20872087
///

rust/src/interaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl FormInputBuilder {
218218
}
219219

220220
/// Form Field: Vertical spacing
221-
pub fn seperator_field(mut self) -> Self {
221+
pub fn separator_field(mut self) -> Self {
222222
let mut result = unsafe { std::mem::zeroed::<BNFormInputField>() };
223223
result.type_ = BNFormInputFieldType::SeparatorFormField;
224224
result.hasDefault = false;

rust/src/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ impl Project {
745745
/// }
746746
/// }
747747
/// ```
748-
// NOTE mut is used here, so only one lock can be aquired at once
748+
// NOTE mut is used here, so only one lock can be acquired at once
749749
pub fn bulk_operation(&mut self) -> Result<ProjectBulkOperationLock, ()> {
750750
Ok(ProjectBulkOperationLock::lock(self))
751751
}

rust/src/symbol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ impl Symbol {
270270
unsafe { BNIsSymbolAutoDefined(self.handle) }
271271
}
272272

273-
/// Wether this symbol has external linkage
273+
/// Whether this symbol has external linkage
274274
pub fn external(&self) -> bool {
275275
self.binding() == Binding::Weak || self.binding() == Binding::Global
276276
}

rust/src/typeprinter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ pub trait TypePrinter {
426426
) -> Option<Vec<InstructionTextToken>>;
427427

428428
/// In a single-line text representation of a type, generate the tokens
429-
/// that should be printed after the type's name. Returns a ist of text
429+
/// that should be printed after the type's name. Returns a list of text
430430
/// tokens representing the type
431431
///
432432
/// * `type_` - Type to print

0 commit comments

Comments
 (0)