Skip to content

Commit

Permalink
fix to Vec
Browse files Browse the repository at this point in the history
  • Loading branch information
vazw committed Jun 3, 2024
1 parent 07c6c6a commit 7725789
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use sqlx::{FromRow, Pool, Sqlite};
use std::collections::HashMap;
use wasm_bindgen::UnwrapThrowExt;

const RELAYS: [&str; 3] = [
"wss://relay.siamstr.com",
"wss://relay.notoshi.win",
"wss://bostr.lecturify.net",
"wss://relay.nostr.band",
const RELAYS: Vec<String> = vec![
"wss://relay.siamstr.com".to_string(),
"wss://relay.notoshi.win".to_string(),
"wss://bostr.lecturify.net".to_string(),
"wss://relay.nostr.band".to_string(),
];
const SIGN_RELAYS: [&str; 1] = ["wss://sign.siamstr.com"];
const SIGN_RELAYS: Vec<String> = vec!["wss://sign.siamstr.com".to_string()];

#[derive(Debug, Deserialize)]
pub struct Name {
Expand Down Expand Up @@ -43,9 +43,9 @@ impl From<UsersData> for NostrUser {
let mut names: HashMap<String, String> = HashMap::new();
names.insert(user.name.clone(), user.pubkey.clone());
let mut relays: HashMap<String, Vec<String>> = HashMap::new();
relays.insert(user.pubkey.clone(), RELAYS.map(str_to_string).to_vec());
relays.insert(user.pubkey.clone(), RELAYS);
let mut nip_46: HashMap<String, Vec<String>> = HashMap::new();
nip_46.insert(user.pubkey.clone(), SIGN_RELAYS.map(str_to_string).to_vec());
nip_46.insert(user.pubkey.clone(), SIGN_RELAYS);
NostrUser {
names,
relays,
Expand Down

0 comments on commit 7725789

Please sign in to comment.