mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-23 15:15:47 +03:00
Update comments; clippy
This commit is contained in:
parent
87252e4523
commit
977dcd37fd
@ -412,7 +412,7 @@ fn analyze_source_file(src: &str, source_file_start_pos: BytePos) -> (Vec<BytePo
|
||||
let src_bytes = src.as_bytes();
|
||||
|
||||
while i < src.len() {
|
||||
let i_usize = i as usize;
|
||||
let i_usize = i;
|
||||
let byte = src_bytes[i_usize];
|
||||
|
||||
// How much to advance to get to the next UTF-8 char in the string.
|
||||
|
@ -51,8 +51,7 @@ impl Package {
|
||||
|
||||
/// Returns `true` if the package name is valid.
|
||||
///
|
||||
/// Package names must be composed solely of ASCII alphanumeric characters,
|
||||
/// and may be word-separated by a single underscore '_'.
|
||||
/// Package names can only contain ASCII alphanumeric characters and underscores.
|
||||
pub fn is_package_name_valid(package_name: &str) -> bool {
|
||||
// Check that the package name is nonempty.
|
||||
if package_name.is_empty() {
|
||||
@ -62,7 +61,7 @@ impl Package {
|
||||
|
||||
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 == '_' {
|
||||
tracing::error!("Project names cannot begin with an underscore");
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user