Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #64

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/oro-node-semver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

TODO:

https://github.com/dart-lang/pub_semver/blob/master/lib/src/version_range.dart cotains a good impl of below operations needed for PubGrub
https://github.com/dart-lang/pub_semver/blob/master/lib/src/version_range.dart contains a good impl of below operations needed for PubGrub


* bool allowsAll(VersionConstraint other);
Expand Down
4 changes: 2 additions & 2 deletions crates/oro-node-semver/src/version_req.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ where
move |input: &'a str| {
context(
"hyphenated",
map(tuple((&left, spaced_hypen, &right)), |(l, _, r)| (l, r)),
map(tuple((&left, spaced_hyphen, &right)), |(l, _, r)| (l, r)),
)(input)
}
}
Expand Down Expand Up @@ -725,7 +725,7 @@ fn no_operation_followed_by_version<'a>(
)(input)
}

fn spaced_hypen<'a>(input: &'a str) -> IResult<&'a str, (), SemverParseError<&'a str>> {
fn spaced_hyphen<'a>(input: &'a str) -> IResult<&'a str, (), SemverParseError<&'a str>> {
map(tuple((space0, tag("-"), space0)), |_| ())(input)
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl VoltCommand for Add {
requested,
} = package
{
// recieve the version of a package that has been requested from the response
// receive the version of a package that has been requested from the response
if *name == response.name {
requested_packages.push(PackageSpec::Npm {
scope: scope.to_owned(),
Expand Down
2 changes: 1 addition & 1 deletion src/commands/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub struct Cache {}

#[async_trait]
impl Command for Cache {
/// Display a help menu for the `volt cahe` command.
/// Display a help menu for the `volt cache` command.
fn help() -> String {
format!(
r#"volt {}
Expand Down
6 changes: 3 additions & 3 deletions src/commands/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,20 @@ impl VoltCommand for Watch {
// progress_bar.finish_with_message("");

// let node_modules = read_dir("node_modules").unwrap();
// let mut availiable_modules: Vec<String> = vec![];
// let mut available_modules: Vec<String> = vec![];

// for entry in node_modules {
// let entry = entry.unwrap();
// if entry.path().is_dir() {
// let path = entry.file_name().to_str().unwrap().to_string();
// availiable_modules.push(path);
// available_modules.push(path);
// }
// }

// let mut missing_modules: Vec<String> = vec![];

// for module in modules {
// if !availiable_modules.contains(&module) {
// if !available_modules.contains(&module) {
// missing_modules.push(module);
// }
// }
Expand Down
2 changes: 1 addition & 1 deletion src/core/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub async fn get_volt_response(package_spec: &PackageSpec) -> Result<VoltRespons

/// downloads and extracts tarball file from package
pub async fn fetch_tarball(package: &VoltPackage, state: State) -> Result<bytes::Bytes> {
// Recieve the tarball from the npm registry
// Receive the tarball from the npm registry
let response = state
.http_client
.get(&package.tarball)
Expand Down
2 changes: 1 addition & 1 deletion src/core/prompt/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ where
/// The default behaviour is to append [`Self::default`] to the prompt to tell the
/// user what is the default value.
///
/// This method does not affect existance of default value, only its display in the prompt!
/// This method does not affect existence of default value, only its display in the prompt!
pub fn show_default(&mut self, val: bool) -> &mut Input<'a, T> {
self.show_default = val;
self
Expand Down
10 changes: 5 additions & 5 deletions src/core/utils/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ pub enum VoltError {
// #[error("failed to decode lz4 encoded data")]
// #[diagnostic(code(volt::decode::lz4::decode))]
// DecodeError(#[source] std::io::Error),
#[error("failed to recieve response from the registry")]
#[error("failed to receive response from the registry")]
#[diagnostic(code(volt::network))]
NetworkError(isahc::Error),

// #[error("failed to recieve byte response")]
// #[error("failed to receive byte response")]
// #[diagnostic(code(volt::network::rec))]
// NetworkRecError(#[source] std::io::Error),
#[error("failed to create directory")]
Expand All @@ -68,7 +68,7 @@ pub enum VoltError {
#[diagnostic(code(volt::registry::volt::bad_request))]
BadRequest { url: String },

#[error("GET {url} - {} - An unknown error occured. Please try again later.")]
#[error("GET {url} - {} - An unknown error occurred. Please try again later.")]
#[diagnostic(code(volt::registry::volt::unknown_error))]
NetworkUnknownError {
url: String,
Expand Down Expand Up @@ -100,7 +100,7 @@ pub enum VoltError {
#[diagnostic(code(volt::network::builder))]
_RequestBuilderError(#[source] isahc::http::Error),

#[error("failed to build recieve response text")]
#[error("failed to build receive response text")]
#[diagnostic(code(volt::io::rec::text))]
_IoTextRecError(#[source] std::io::Error),

Expand Down Expand Up @@ -132,7 +132,7 @@ pub enum VoltError {
#[diagnostic(code(volt::git::parse))]
GitConfigParseError { error_text: String },

#[error("an unknown error occured.")]
#[error("an unknown error occurred.")]
#[diagnostic(code(volt::unknown))]
_UnknownError,
}
6 changes: 3 additions & 3 deletions src/core/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,22 +342,22 @@ pub fn verify_existing_installation(

pub fn verify_checksum(
response: &bytes::Bytes,
expeced_checksum: &str,
expected_checksum: &str,
) -> Result<(bool, Option<String>)> {
// begin
// there are only 2 supported algorithms
// sha1 and sha512
// so we can be sure that if it doesn't start with sha1, it's going to have to be sha512

let algorithm = if expeced_checksum.starts_with("sha1") {
let algorithm = if expected_checksum.starts_with("sha1") {
Algorithm::Sha1
} else {
Algorithm::Sha512
};

let calculated_checksum = VoltConfig::calc_hash(response, algorithm)?;

if calculated_checksum == expeced_checksum {
if calculated_checksum == expected_checksum {
Ok((true, None))
} else {
Ok((false, Some(calculated_checksum)))
Expand Down