si certo.. ma ci sono tanti concetti non base mi pare di capire
Читать полностью…quando vedo Tokio penso alla casa di carta.. pensa un pò
Читать полностью…ah, ma è da usare quando hai a che fare con async?
Читать полностью…Arc<qualcosa> è Copy anche se la cosa al suo interno non è copy
Читать полностью…puoi provare a fare #derive(Clone) non so se funziona sinceramente
Читать полностью…La tua config ha una string che è una roba che vive sull'heap (anche se a te non deve fregartene) ma insomma ci interessa l'ownership, non è come "u8" che puoi semplicemente copiarlo in giro
Читать полностью…se sono chiuse magari c'è una soluzione, anche se sono aperte in realtà se danno dei workaround
Читать полностью…Il file in questione è questo. cargo test mi fa il run dei test senza problemi, ma da dentro neovim nisba
Читать полностью…Qualcuno usa come ide neovim con neotest? Non capisco come mai non mi trova i test dentro al file su cui sto lavorando
Читать полностью…ok .. devo studiarmi Arc, ancora sono a 0 rust async
Читать полностью…quando va a 0 cancella l'oggetto e risolve il problema
Читать полностью…Arc tiene traccia con un numero di quante reference esistono a quella cosa che hai
Читать полностью…invece di usare il borrow system usi praticamente quello che in C++ è uno shared_ptr
Читать полностью…per renderla Sync si usa una cosa che si chiama Arc
Читать полностью…per mettere una variabile in una funzione async deve avere Sync come trait. Se usi una runtime multithread anche Send
Читать полностью…sarà un problema del plugin, hai visto se ci sono issue a riguardo chiuse o aperte?
Читать полностью…use std::fs;Читать полностью…
fn open_file(file_path: &str) -> String {
fs::read_to_string(file_path).expect("Failed to read file")
}
fn main() {
let contents = open_file("test.txt");
println!("{}", contents);
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_open_file() {
let content: String = open_file("test.txt");
assert_eq!(content, "hello world\n");
}
}
pero' ha chiesto IL server, non il dominio ... non e' che dietro github.com o crates.io ci sia UN server solo, secondo me voleva proprio sapere l'hostname 🤣
Читать полностью…