Hey all,
I'm currently building a dApp with rust and came across an error Im trying to troubleshoot..
Here is the error that Im getting in Terminal when I test it:
error: this file contains an unclosed delimiter
--> programs/solana-twitter/src/lib.rs:70:3
|
7 | pub mod solana_twitter {
| - unclosed delimiter
8 | use super::*;
9 | pub fn send_tweet(ctx: Context<SendTweet>, topic: String, content: String) -> ProgramResult {
| - this delimiter might not be properly closed...
...
27 | }
| - ...as it matches this but it has different indentation
...
70 | }
| ^
And here is the code that I believe its pointing to:
#[program]
pub mod solana_twitter {
use super::*;
pub fn send_tweet(ctx: Context<SendTweet>, topic: String, content: String) -> ProgramResult {
let tweet: &mut Account<Tweet> = &mut ctx.accounts.tweet;
let author: &Signer = &ctx.accounts.author;
let clock: Clock = Clock::get().unwrap();
if topic.chars().count() > 50 {
return Err(ErrorCode::TopicTooLong.into())
}
if content.chars().count() > 280 {
return Err(ErrorCode::ContentTooLong.into())
}
tweet.author = *author.key;
tweet.timestamp = clock.unix_timestamp;
tweet.topic = topic;
tweet.content = content;
Ok(())
}