fn execute_query(_query: &str) -> Result<(), &'static str> {
        Err("I'm afraid I can't do that")
      }
      fn main() {
        env_logger::init();
        let response = execute_query("DROP TABLE students");
        if let Err(err) = response {
          log::error!("Failed to execute query: {}", err);
        }
      }
      

      Rust language logoLog error

      Codiga's Rust Recipes

      log an error in the console

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.