Skip to content

Commit

Permalink
Fix use of "via"
Browse files Browse the repository at this point in the history
I always thought it was an abbreviation.
  • Loading branch information
madsmtm committed Oct 3, 2024
1 parent 94f104f commit 67a4acd
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 24 deletions.
6 changes: 3 additions & 3 deletions crates/header-translator/src/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ fn mainthreadonly_override<'a>(
}

if any_argument_provides_mainthreadmarker {
// MainThreadMarker can be retrieved via. `MainThreadOnly::mtm`
// MainThreadMarker can be retrieved via `MainThreadOnly::mtm`
// inside these methods, and hence passing it is redundant.
false
} else if result_type_requires_mainthreadmarker {
Expand Down Expand Up @@ -373,11 +373,11 @@ impl Method {

// Don't emit memory-management methods
match &*selector {
// Available via. `ClassType`
// Available via `ClassType`
"alloc" | "allocWithZone:" if is_class => {
return None;
}
// Available via. `Retained` (and disallowed by ARC).
// Available via `Retained` (and disallowed by ARC).
"retain" | "release" | "autorelease" | "dealloc" if !is_class => {
return None;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/header-translator/src/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ impl Stmt {
| EntityKind::ObjCProtocolRef => {}
EntityKind::ParmDecl => {
parse_fn_param_children(&entity, context);
// Could also be retrieved via. `get_arguments`
// Could also be retrieved via `get_arguments`
let name = entity.get_name().unwrap_or_else(|| "_".into());
let ty = entity.get_type().expect("function argument type");
let ty = Ty::parse_function_argument(ty, context);
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2-exception-helper/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() {
// this is probably going to fail anyways, since we're using newer
// runtimes than GCC supports.
//
// TODO: ObjFW via. `-fobjc-runtime=objfw-VERSION`. Clang defaults to 0.8
// TODO: ObjFW via `-fobjc-runtime=objfw-VERSION`. Clang defaults to 0.8
if env::var_os("CARGO_FEATURE_GNUSTEP_2_1").is_some() {
builder.flag("-fobjc-runtime=gnustep-2.1");
} else if env::var_os("CARGO_FEATURE_GNUSTEP_2_0").is_some() {
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/__macro_helpers/declared_ivars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ pub(crate) fn register_with_ivars<T: DeclaredClass>(
} else {
// Fallback to an offset of zero.
//
// This is fine, since any reads here will only be via. zero-sized
// This is fine, since any reads here will only be via zero-sized
// ivars, where the actual pointer doesn't matter.
0
};
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ use crate::runtime::{AnyObject, Imp, Sel};
/// in Objective-C with the type in question.
///
/// You should also beware of having [`Drop`] types implement this, since when
/// passed to Objective-C via. `objc2::msg_send!` their destructor will not be
/// passed to Objective-C via `objc2::msg_send!` their destructor will not be
/// called!
///
///
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/macros/declare_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ macro_rules! declare_class {
} else {
// Fall back to an offset of zero.
//
// This is fine, since any reads here will only be via. zero-sized
// This is fine, since any reads here will only be via zero-sized
// ivars, where the actual pointer doesn't matter.
0
}
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/macros/extern_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/// - The [`Super`] class.
///
/// Due to Rust trait limitations, specifying e.g. the superclass `NSData`
/// would not give you the ability to convert via. `AsRef` to `NSObject`.
/// would not give you the ability to convert via `AsRef` to `NSObject`.
/// Therefore, you may optionally specify additional parts of the
/// inheritance chain using an `#[inherits(...)]` attribute.
/// - Optionally, the class' [`ThreadKind`], if the object is only usable on
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/main_thread_marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn is_main_thread() -> bool {

// SAFETY: The signature in here is the exact same as in `libc`.
//
// `pthread_main_np` is included via. `libSystem` when `libstd` is
// `pthread_main_np` is included via `libSystem` when `libstd` is
// linked. All of this is done to avoid a dependency on the `libc`
// crate.
//
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/rc/retained.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ use crate::{ffi, ClassType, DowncastTarget, Message};
/// // Or:
/// // let string = NSString::new();
///
/// // Methods on `NSString` is usable via. `Deref`
/// // Methods on `NSString` is usable via `Deref`
/// # #[cfg(available_in_foundation)]
/// assert_eq!(string.length(), 0);
///
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/rc/test_object.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Note: This file is included in the `tests` crate via. a symlink as well.
//! Note: This file is included in the `tests` crate viaa symlink as well.
use core::cell::RefCell;
use core::ptr;

Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/runtime/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::encode::{Encode, Encoding, RefEncode};
//
// Don't be fooled by the backup definition in `objc.h`; __OBJC_BOOL_IS_BOOL
// is always defined by `clang` when compiling Objective-C sources. The below
// cfgs are determined experimentally via. cross compiling.
// cfgs are determined experimentally via cross compiling.
//
// See also <https://www.jviotti.com/2024/01/05/is-objective-c-bool-a-boolean-type-it-depends.html>.
#[cfg(all(not(feature = "gnustep-1-7"), not(feature = "unstable-objfw")))]
Expand Down
4 changes: 2 additions & 2 deletions crates/objc2/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ impl fmt::Display for AnyProtocol {
///
/// This is an opaque type that contains [`UnsafeCell`], and is similar to
/// that in that one can safely access and perform interior mutability on this
/// (both via. [`msg_send!`] and through ivars), so long as Rust's mutability
/// (both via [`msg_send!`] and through ivars), so long as Rust's mutability
/// rules are upheld, and that data races are avoided.
///
/// Note: This is intentionally neither [`Sync`], [`Send`], [`UnwindSafe`],
Expand Down Expand Up @@ -1212,7 +1212,7 @@ impl AnyObject {
let ptr = unsafe { ffi::object_getClass(self) };
// SAFETY: The class is not NULL because the object is not NULL, and
// it is safe as `'static` since classes are static, and it could be
// retrieved via. `AnyClass::get(self.class().name())` anyhow.
// retrieved via `AnyClass::get(self.class().name())` anyhow.
unsafe { ptr.as_ref().unwrap_unchecked() }
}

Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/topics/about_generated/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
# After
# Moved to `objc2-foundation` and `objc2-app-kit` crates.
[dependencies]
# Removed `Foundation_NSMutableArray`, it is included via. `NSArray`.
# Removed `Foundation_NSMutableArray`, it is included via `NSArray`.
# Added `NSObject` as the `NSCopying` protocol comes from there.
objc2-foundation = { version = "0.2", features = ["NSNotification", "NSString", "NSThread", "NSObject", "NSArray"] }
# Added `NSResponder` as it's required by `NSApplication`.
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/topics/kvo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Key-Value Observing (KVO) is a mechanism that allows an object to be notified of changes to properties of another object.

This is exposed via. the `NSKeyValueCoding` and `NSKeyValueObserving` categories / informal protocols on `NSObject`.
This is exposed via the `NSKeyValueCoding` and `NSKeyValueObserving` categories / informal protocols on `NSObject`.

See Apple's documentation on [Key-Value Coding][kvc-doc], [Key-Value Observing][kvo-doc] and [Swift's documentation on KVO][swift-kvo] for more information.

Expand Down
2 changes: 1 addition & 1 deletion framework-crates/objc2-foundation/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl<ObjectType: Message> NSMutableArray<ObjectType> {
/// first, see [the docs][collections-own].
///
/// This means that we can more efficiently access the array's objects, but
/// _only_ if the array isn't mutated via. e.g. `NSMutableArray` methods while
/// _only_ if the array isn't mutated via e.g. `NSMutableArray` methods while
/// doing so - otherwise, we might end up accessing a deallocated object.
///
/// [collections-own]: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html#//apple_ref/doc/uid/TP40004447-SW12
Expand Down
4 changes: 2 additions & 2 deletions framework-crates/objc2-foundation/src/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType> {
// mutated, it'll "just" corrupt the collection's invariants (but
// won't cause undefined behaviour).
//
// This is tested via. fuzzing in `collection_interior_mut.rs`.
// This is tested via fuzzing in `collection_interior_mut.rs`.
//
// <https://developer.apple.com/library/archive/documentation/General/Conceptual/CocoaEncyclopedia/ObjectMutability/ObjectMutability.html#//apple_ref/doc/uid/TP40010810-CH5-SW69>
unsafe { Self::initWithObjects_forKeys_count(Self::alloc(), objects, keys, count) }
Expand Down Expand Up @@ -184,7 +184,7 @@ impl<KeyType: Message, ObjectType: Message> NSMutableDictionary<KeyType, ObjectT
/// first, see [the docs][collections-own].
///
/// This means that we can more efficiently access the dictionary's keys and
/// objects, but _only_ if the dictionary isn't mutated via. e.g.
/// objects, but _only_ if the dictionary isn't mutated via e.g.
/// `NSMutableDictionary` methods while doing so - otherwise, we might end up
/// accessing a deallocated object.
///
Expand Down
2 changes: 1 addition & 1 deletion framework-crates/objc2-foundation/src/main_thread_bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub struct MainThreadBound<T>(ManuallyDrop<T>);
// Finally, the value is dropped on the main thread in `Drop`.
unsafe impl<T> Send for MainThreadBound<T> {}

// SAFETY: We only provide access to the inner value via. `get` and `get_mut`.
// SAFETY: We only provide access to the inner value via `get` and `get_mut`.
//
// Both of these take [`MainThreadMarker`], which guarantees that the access
// is done from the main thread.
Expand Down
2 changes: 1 addition & 1 deletion framework-crates/objc2-foundation/src/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<ObjectType: Message> NSMutableSet<ObjectType> {
/// first, see [the docs][collections-own].
///
/// This means that we can more efficiently access the set's objects, but
/// _only_ if the set isn't mutated via. e.g. `NSMutableSet` methods while
/// _only_ if the set isn't mutated via e.g. `NSMutableSet` methods while
/// doing so - otherwise, we might end up accessing a deallocated object.
///
/// [collections-own]: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html#//apple_ref/doc/uid/TP40004447-SW12
Expand Down
3 changes: 1 addition & 2 deletions framework-crates/objc2-metal/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::MTLResourceID;

impl MTLResourceID {
/// Construct a `MTLResourceID` from an ID previously gotten via.
/// `to_raw`.
/// Construct a `MTLResourceID` from an ID previously gotten via `to_raw`.
///
/// # Safety
///
Expand Down

0 comments on commit 67a4acd

Please sign in to comment.