mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
implement shared redirection Response builder
This commit is contained in:
parent
86a6ad058a
commit
86d191cc46
2 changed files with 69 additions and 44 deletions
13
src/tool.rs
13
src/tool.rs
|
|
@ -1,7 +1,7 @@
|
|||
//! Some shared helpers collection
|
||||
|
||||
// Global dependencies
|
||||
use gtk::glib::{DateTime, GString, Uri};
|
||||
use gtk::glib::{DateTime, GString};
|
||||
|
||||
/// Format bytes to KB/MB/GB presentation
|
||||
pub fn format_bytes(value: usize) -> String {
|
||||
|
|
@ -34,14 +34,3 @@ pub fn format_time(t: &DateTime) -> GString {
|
|||
pub fn now() -> DateTime {
|
||||
DateTime::now_local().unwrap() // @TODO handle?
|
||||
}
|
||||
|
||||
/// Compare `subject` with `base`
|
||||
pub fn _is_external(subject: &Uri, base: &Uri) -> bool {
|
||||
if subject.scheme() != base.scheme() {
|
||||
return true;
|
||||
}
|
||||
if subject.port() != base.port() {
|
||||
return true;
|
||||
}
|
||||
subject.host() != base.host()
|
||||
} // @TODO not in use
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue