pull/68/head
Jonas Kruckenberg 2 years ago
commit 263185be34

@ -28,42 +28,30 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: install webkit2gtk
- name: install webkit2gtk and libudev for [authenticator]
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0 sudo apt-get install -y webkit2gtk-4.0 libudev-dev
- name: install libudev for [authenticator]
run: |
sudo apt-get install -y libudev-dev
- name: Install clippy with stable toolchain - name: Install clippy with stable toolchain
uses: actions-rs/toolchain@v1 uses: dtolnay/rust-toolchain@stable
with: with:
profile: minimal
toolchain: stable
override: true
components: clippy components: clippy
- uses: Swatinem/rust-cache@v1 - uses: Swatinem/rust-cache@v1
- uses: actions-rs/clippy-check@v1 - name: clippy
with: run: cargo clippy --workspace --exclude 'tauri-plugin-sql' --all-targets --all-features -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --exclude 'tauri-plugin-sql' --all-targets --all-features -- -D warnings - name: clippy sql:sqlite
name: clippy run: cargo clippy --package 'tauri-plugin-sql' --all-targets --features sqlite -- -D warnings
- uses: actions-rs/clippy-check@v1
with: - name: clippy sql:mysql
token: ${{ secrets.GITHUB_TOKEN }} run: cargo clippy --package 'tauri-plugin-sql' --all-targets --features mysql -- -D warnings
args: --workspace --package 'tauri-plugin-sql' --all-targets --features sqlite -- -D warnings
name: clippy sql:sqlite - name: clippy sql:postgres
- uses: actions-rs/clippy-check@v1 run: cargo clippy --package 'tauri-plugin-sql' --all-targets --features postgres -- -D warnings
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --package 'tauri-plugin-sql' --all-targets --features mysql -- -D warnings
name: clippy sql:mysql
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --package 'tauri-plugin-sql' --all-targets --features postgres -- -D warnings
name: clippy sql:postgres
fmt: fmt:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -72,14 +60,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install rustfmt with nightly toolchain - name: Install rustfmt with nightly toolchain
uses: actions-rs/toolchain@v1 uses: dtolnay/rust-toolchain@nightly
with: with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt components: rustfmt
- uses: actions-rs/cargo@v1
with: - name: Check formatting
command: fmt run: cargo fmt --all -- --check
args: --all -- --check

@ -1 +1,14 @@
authenticator
autostart
fs-extra
fs-watch
localhost
log
persisted-scope
positioner
sql
store
stronghold
upload
websocket websocket
window-state

@ -54,13 +54,13 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
.map_err(Error::from) .map_err(Error::from)
.and_then(|scope| bincode::deserialize(&scope).map_err(Into::into)) .and_then(|scope| bincode::deserialize(&scope).map_err(Into::into))
.unwrap_or_default(); .unwrap_or_default();
for allowed in scope.allowed_paths { for allowed in &scope.allowed_paths {
// allows the path as is // allows the path as is
let _ = fs_scope.allow_file(allowed); let _ = fs_scope.allow_file(allowed);
#[cfg(feature = "protocol-asset")] #[cfg(feature = "protocol-asset")]
let _ = asset_protocol_scope.allow_file(allowed); let _ = asset_protocol_scope.allow_file(allowed);
} }
for forbidden in scope.forbidden_patterns { for forbidden in &scope.forbidden_patterns {
// forbid the path as is // forbid the path as is
let _ = fs_scope.forbid_file(forbidden); let _ = fs_scope.forbid_file(forbidden);
#[cfg(feature = "protocol-asset")] #[cfg(feature = "protocol-asset")]

@ -244,12 +244,12 @@ async fn save<R: Runtime>(
} }
#[derive(Default)] #[derive(Default)]
pub struct PluginBuilder { pub struct Builder {
stores: HashMap<PathBuf, Store>, stores: HashMap<PathBuf, Store>,
frozen: bool, frozen: bool,
} }
impl PluginBuilder { impl Builder {
/// Registers a store with the plugin. /// Registers a store with the plugin.
/// ///
/// # Examples /// # Examples

Loading…
Cancel
Save