core: Implement `Display` for `NavigationMethod`

This commit is contained in:
Mike Welsh 2023-04-05 13:09:17 -07:00
parent 711a012fea
commit 7d7fe1bfdd
1 changed files with 11 additions and 0 deletions

View File

@ -3,6 +3,7 @@
use crate::loader::Error;
use crate::string::WStr;
use indexmap::IndexMap;
use std::fmt;
use std::future::Future;
use std::path::{Path, PathBuf};
use std::pin::Pin;
@ -40,6 +41,16 @@ impl NavigationMethod {
}
}
impl fmt::Display for NavigationMethod {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let method = match self {
Self::Get => "GET",
Self::Post => "POST",
};
f.write_str(method)
}
}
/// A fetch request.
pub struct Request {
/// The URL of the request.