Skip to content

Commit d240463

Browse files
authored
fix some typos (#4795)
Signed-off-by: cuishuang <[email protected]>
1 parent 9b8f0a7 commit d240463

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

app/initializers/hashchange.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function findElementByFragmentName(document, name) {
1414
try {
1515
return document.querySelector(`#${name}`) || document.getElementsByName(name)[0];
1616
} catch {
17-
// Catches execptions thrown when an anchor in a readme was invalid (see issue #3108)
17+
// Catches exceptions thrown when an anchor in a readme was invalid (see issue #3108)
1818
return;
1919
}
2020
}

src/bin/background-worker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! are unable to spawn workers to run jobs (either because we couldn't connect
66
//! to the DB, an error occurred while loading, or we just never heard back from
77
//! the worker thread), we will rebuild the runner and try again up to 5 times.
8-
//! After the 5th occurrance, we will panic.
8+
//! After the 5th occurrence, we will panic.
99
//!
1010
//! Usage:
1111
//! cargo run --bin background-worker

src/controllers/version/metadata.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Endpoints that expose metadata about crate versions
22
//!
3-
//! These endpoints provide data that could be obtained direclty from the
3+
//! These endpoints provide data that could be obtained directly from the
44
//! index or cached metadata which was extracted (client side) from the
55
//! `Cargo.toml` file.
66
@@ -13,7 +13,7 @@ use super::{extract_crate_name_and_semver, version_and_crate};
1313

1414
/// Handles the `GET /crates/:crate_id/:version/dependencies` route.
1515
///
16-
/// This information can be obtained direclty from the index.
16+
/// This information can be obtained directly from the index.
1717
///
1818
/// In addition to returning cached data from the index, this returns
1919
/// fields for `id`, `version_id`, and `downloads` (which appears to always

src/downloads_counter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::sync::atomic::{AtomicI64, AtomicUsize, Ordering};
1212
/// To avoid locking the whole data structure behind a RwLock, which could potentially delay
1313
/// requests, this uses the dashmap crate. A DashMap has the same public API as an HashMap, but
1414
/// stores the items into `num_cpus()*4` individually locked shards. This approach reduces the
15-
/// likelyhood of a request encountering a locked shard.
15+
/// likelihood of a request encountering a locked shard.
1616
///
1717
/// Persisting the download counts in the database also takes advantage of the inner sharding of
1818
/// DashMaps: to avoid locking all the download requests at the same time each iteration only
@@ -124,7 +124,7 @@ impl DownloadsCounter {
124124
// as we'd lose the downloads from the aborted transaction.
125125
//
126126
// Ensuring the rows are inserted in a consistent order (in our case by sorting them by
127-
// the version ID) will prevent deadlocks from occuring. For more information:
127+
// the version ID) will prevent deadlocks from occurring. For more information:
128128
//
129129
// https://www.postgresql.org/docs/11/explicit-locking.html#LOCKING-DEADLOCKS
130130
//

src/tests/krate/search.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ fn test_zero_downloads() {
622622

623623
/* Given two crates, one with more all-time downloads, the other with
624624
more downloads in the past 90 days, check that the index page for
625-
categories and keywords is sorted by recent downlaods by default.
625+
categories and keywords is sorted by recent downloads by default.
626626
*/
627627
#[test]
628628
fn test_default_sort_recent() {

src/tests/owners.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ fn owners_can_remove_self() {
198198
json!({ "msg": "owners successfully removed", "ok": true })
199199
);
200200

201-
// After you delete yourself, you no longer have permisions to manage the crate.
201+
// After you delete yourself, you no longer have permissions to manage the crate.
202202
let response = token.remove_named_owner("owners_selfremove", username);
203203
assert_eq!(response.status(), StatusCode::OK);
204204
assert_eq!(

src/tests/team.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ fn crates_by_team_id() {
352352

353353
#[test]
354354
fn crates_by_team_id_not_including_deleted_owners() {
355-
// This needs to use the proxy beacuse removing a team checks with github that you're on the
355+
// This needs to use the proxy because removing a team checks with github that you're on the
356356
// team before you're allowed to remove it from the crate
357357
let (app, anon) = TestApp::with_proxy().empty();
358358
let user = app.db_new_user(mock_user_on_both_teams().gh_login);

src/tests/user.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ fn updating_existing_user_doesnt_change_api_token() {
381381
382382
This bug is problematic if the user's email preferences
383383
are set to private on GitHub, as GitHub will always
384-
send none as the email and we will end up inadvertenly
384+
send none as the email and we will end up inadvertently
385385
deleting their email when they sign back in.
386386
*/
387387
#[test]

src/util/errors/json.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn json_error(detail: &str, status: StatusCode) -> AppResponse {
1515
response
1616
}
1717

18-
// The following structs are emtpy and do not provide a custom message to the user
18+
// The following structs are empty and do not provide a custom message to the user
1919

2020
#[derive(Debug)]
2121
pub(crate) struct NotFound;

0 commit comments

Comments
 (0)