Fixed single character patterns using double quotes
This commit is contained in:
parent
9a29f4e876
commit
7c6f3278ba
|
@ -964,12 +964,12 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
|
|||
let has_validator = info
|
||||
.values
|
||||
.keys()
|
||||
.any(|k| k.split(".").next() == Some(name));
|
||||
.any(|k| k.split('.').next() == Some(name));
|
||||
|
||||
let value_constructors = info
|
||||
.values
|
||||
.keys()
|
||||
.map(|k| k.split(".").next().unwrap_or(k).to_string())
|
||||
.map(|k| k.split('.').next().unwrap_or(k).to_string())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
return Some(
|
||||
|
|
|
@ -173,8 +173,8 @@ fn generate_module(
|
|||
let comment = Comment::from((span, module.code.as_str()))
|
||||
.content
|
||||
.trim_start();
|
||||
if comment.starts_with("#") {
|
||||
let trimmed = comment.trim_start_matches("#");
|
||||
if comment.starts_with('#') {
|
||||
let trimmed = comment.trim_start_matches('#');
|
||||
let heading = comment.len() - trimmed.len();
|
||||
Some((
|
||||
span,
|
||||
|
|
|
@ -64,8 +64,8 @@ impl LinkTree {
|
|||
/// Strip prefix and ensures to remove any leading slash "/" as well.
|
||||
fn strip_prefix(source: &str, prefix: &str) -> String {
|
||||
let result = source.strip_prefix(prefix).unwrap();
|
||||
if result.starts_with("/") {
|
||||
result.strip_prefix("/").unwrap().to_string()
|
||||
if result.starts_with('/') {
|
||||
result.strip_prefix('/').unwrap().to_string()
|
||||
} else {
|
||||
result.to_string()
|
||||
}
|
||||
|
@ -206,10 +206,10 @@ impl LinkTree {
|
|||
LinkTree::Empty => vec![],
|
||||
|
||||
LinkTree::Leaf { value } => {
|
||||
let last_ix = value.split("/").count();
|
||||
let last_ix = value.split('/').count();
|
||||
let module_path = mk_path(value);
|
||||
value
|
||||
.split("/")
|
||||
.split('/')
|
||||
.enumerate()
|
||||
.map(|(offset, segment)| {
|
||||
if offset == last_ix - 1 {
|
||||
|
|
Loading…
Reference in New Issue