Update comments; clippy

This commit is contained in:
d0cd 2022-10-13 16:03:23 -05:00
parent 87252e4523
commit 977dcd37fd
2 changed files with 3 additions and 4 deletions

View File

@ -412,7 +412,7 @@ fn analyze_source_file(src: &str, source_file_start_pos: BytePos) -> (Vec<BytePo
let src_bytes = src.as_bytes(); let src_bytes = src.as_bytes();
while i < src.len() { while i < src.len() {
let i_usize = i as usize; let i_usize = i;
let byte = src_bytes[i_usize]; let byte = src_bytes[i_usize];
// How much to advance to get to the next UTF-8 char in the string. // How much to advance to get to the next UTF-8 char in the string.

View File

@ -51,8 +51,7 @@ impl Package {
/// Returns `true` if the package name is valid. /// Returns `true` if the package name is valid.
/// ///
/// Package names must be composed solely of ASCII alphanumeric characters, /// Package names can only contain ASCII alphanumeric characters and underscores.
/// and may be word-separated by a single underscore '_'.
pub fn is_package_name_valid(package_name: &str) -> bool { pub fn is_package_name_valid(package_name: &str) -> bool {
// Check that the package name is nonempty. // Check that the package name is nonempty.
if package_name.is_empty() { if package_name.is_empty() {
@ -62,7 +61,7 @@ impl Package {
let first = package_name.chars().next().unwrap(); let first = package_name.chars().next().unwrap();
// Check that the first character is not a dash. // Check that the first character is not an underscore.
if first == '_' { if first == '_' {
tracing::error!("Project names cannot begin with an underscore"); tracing::error!("Project names cannot begin with an underscore");
return false; return false;