Fixed single character patterns using double quotes

This commit is contained in:
Riley-Kilgore 2024-09-24 08:32:41 -07:00 committed by Lucas
parent 9a29f4e876
commit 7c6f3278ba
3 changed files with 8 additions and 8 deletions

View File

@ -964,12 +964,12 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
let has_validator = info let has_validator = info
.values .values
.keys() .keys()
.any(|k| k.split(".").next() == Some(name)); .any(|k| k.split('.').next() == Some(name));
let value_constructors = info let value_constructors = info
.values .values
.keys() .keys()
.map(|k| k.split(".").next().unwrap_or(k).to_string()) .map(|k| k.split('.').next().unwrap_or(k).to_string())
.collect::<Vec<_>>(); .collect::<Vec<_>>();
return Some( return Some(

View File

@ -173,8 +173,8 @@ fn generate_module(
let comment = Comment::from((span, module.code.as_str())) let comment = Comment::from((span, module.code.as_str()))
.content .content
.trim_start(); .trim_start();
if comment.starts_with("#") { if comment.starts_with('#') {
let trimmed = comment.trim_start_matches("#"); let trimmed = comment.trim_start_matches('#');
let heading = comment.len() - trimmed.len(); let heading = comment.len() - trimmed.len();
Some(( Some((
span, span,

View File

@ -64,8 +64,8 @@ impl LinkTree {
/// Strip prefix and ensures to remove any leading slash "/" as well. /// Strip prefix and ensures to remove any leading slash "/" as well.
fn strip_prefix(source: &str, prefix: &str) -> String { fn strip_prefix(source: &str, prefix: &str) -> String {
let result = source.strip_prefix(prefix).unwrap(); let result = source.strip_prefix(prefix).unwrap();
if result.starts_with("/") { if result.starts_with('/') {
result.strip_prefix("/").unwrap().to_string() result.strip_prefix('/').unwrap().to_string()
} else { } else {
result.to_string() result.to_string()
} }
@ -206,10 +206,10 @@ impl LinkTree {
LinkTree::Empty => vec![], LinkTree::Empty => vec![],
LinkTree::Leaf { value } => { LinkTree::Leaf { value } => {
let last_ix = value.split("/").count(); let last_ix = value.split('/').count();
let module_path = mk_path(value); let module_path = mk_path(value);
value value
.split("/") .split('/')
.enumerate() .enumerate()
.map(|(offset, segment)| { .map(|(offset, segment)| {
if offset == last_ix - 1 { if offset == last_ix - 1 {