Skip to content

Commit

Permalink
fix some blanks
Browse files Browse the repository at this point in the history
  • Loading branch information
Astavie committed May 12, 2024
1 parent feadb5c commit fcf4cf6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cah/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl<const C: CardType> Card<C> {
// trim spaces around blank
let before = prompt[..pos].trim_end();

let underscore = prompt.chars().nth(pos).unwrap() == '_';
let underscore = prompt.as_bytes()[pos] == b'_';
let size = if underscore { 1 } else { 2 };
let after = prompt[pos + size..].trim_start();

Expand Down
10 changes: 8 additions & 2 deletions src/cah/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl Ingame {

msg.fields.push(Field::new(
"Prompt",
escape_string(self.prompt.text(&self.packs)),
self.prompt.fill(&self.packs, &mut std::iter::empty()),
));

msg.append_action(Action::ShowHand, ButtonStyle::Primary, "Show Hand".into());
Expand Down Expand Up @@ -82,7 +82,13 @@ impl Ingame {
.iter()
.copied()
.enumerate()
.map(|(i, c)| format!("{}. ``{}``", i + 1, c.text(&self.packs)))
.map(|(i, c)| {
format!(
"{}. ``{}``",
i + 1,
c.fill(&self.packs, &mut std::iter::empty())
)
})
.collect::<Vec<_>>()
.join("\n"),
));
Expand Down

0 comments on commit fcf4cf6

Please sign in to comment.