Skip to content

Commit

Permalink
Fixed single character patterns using double quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Riley-Kilgore authored and rvcas committed Sep 24, 2024
1 parent 9a29f4e commit 7c6f327
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/aiken-lang/src/tipo/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions crates/aiken-project/src/docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions crates/aiken-project/src/docs/link_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7c6f327

Please sign in to comment.