Creates a new drive for the current window.
()
| 136 | impl WebDrive { |
| 137 | /// Creates a new drive for the current window. |
| 138 | pub fn from_window() -> Self { |
| 139 | // TODO(jmmv): Should probably do something fancier here instead of these unwraps... |
| 140 | let window = web_sys::window().unwrap(); |
| 141 | let storage = window.local_storage().unwrap().unwrap(); |
| 142 | let mut drive = Self { clock: Box::from(JsClock::default()), storage }; |
| 143 | drive.fixup_names().unwrap(); |
| 144 | drive |
| 145 | } |
| 146 | |
| 147 | /// Upgrades the drive to support case insensitive behavior. |
| 148 | /// |
nothing calls this directly
no test coverage detected