mirror of
https://git.alemi.dev/guestbook.rs.git
synced 2024-11-12 19:39:28 +01:00
fix: slicing larger indexes explodes
This commit is contained in:
parent
7aee304b70
commit
d6b5ff42be
1 changed files with 2 additions and 2 deletions
|
@ -47,8 +47,8 @@ async fn send_suggestion(payload: Insertion, state: SafeContext) -> impl IntoRes
|
|||
let avatar = hasher.finalize();
|
||||
let page = GuestBookPage {
|
||||
avatar: format!("{:x}", avatar),
|
||||
author: payload.author.map(|x| x[..25].to_string()), // TODO don't hardcode char limits!
|
||||
contact: payload.contact.clone().map(|x| x[..50].to_string()),
|
||||
author: payload.author.map(|x| x.chars().take(25).collect()), // TODO don't hardcode char limits!
|
||||
contact: payload.contact.clone().map(|x| x.chars().take(50).collect()),
|
||||
body: payload.body,
|
||||
date: Utc::now(),
|
||||
url: match payload.contact {
|
||||
|
|
Loading…
Reference in a new issue