mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
cargo clippy
This commit is contained in:
@@ -66,19 +66,6 @@ impl ScopedBrowserAccess {
|
|||||||
browser_name: browser_name.to_string(),
|
browser_name: browser_name.to_string(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// First requests access to browser directory and then ensures access is still usable
|
|
||||||
pub fn request_and_start(browser_name: &str) -> Result<Self> {
|
|
||||||
Self::request_only(browser_name)?;
|
|
||||||
Self::resume(browser_name)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn has_stored_access(browser_name: &str) -> bool {
|
|
||||||
let Ok(c_name) = CString::new(browser_name) else {
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
unsafe { hasStoredBrowserAccess(c_name.as_ptr()) }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "sandbox")]
|
#[cfg(feature = "sandbox")]
|
||||||
|
|||||||
@@ -1192,6 +1192,7 @@ pub mod chromium_importer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[napi]
|
#[napi]
|
||||||
|
#[allow(unused_variables)]
|
||||||
pub fn request_browser_access(browser: String) -> napi::Result<()> {
|
pub fn request_browser_access(browser: String) -> napi::Result<()> {
|
||||||
#[cfg(all(target_os = "macos", feature = "sandbox"))]
|
#[cfg(all(target_os = "macos", feature = "sandbox"))]
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,8 +27,4 @@ in `apps/desktop/desktop_native/napi/src/lib.rs` which returns an `Ok` unit vari
|
|||||||
|
|
||||||
- `resume()` is responsible for determining if a security scoped bookmark exists and is valid, if so, it will be used to access the browser directory.
|
- `resume()` is responsible for determining if a security scoped bookmark exists and is valid, if so, it will be used to access the browser directory.
|
||||||
|
|
||||||
- `request_and_start()` encapsulates both of the functions described above into a single function call.
|
|
||||||
|
|
||||||
- `has_stored_access()` and `drop()` are self-explanatory helper functions.
|
|
||||||
|
|
||||||
- See directory `apps/desktop/desktop_native/objc/src/native/chromium_importer` for the native Objective-C and Swift code. Instead of removing debug output I've commented out `NSLog` statements since they may be useful in the future.
|
- See directory `apps/desktop/desktop_native/objc/src/native/chromium_importer` for the native Objective-C and Swift code. Instead of removing debug output I've commented out `NSLog` statements since they may be useful in the future.
|
||||||
Reference in New Issue
Block a user