treewide: cleanup
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ia01590cdeed872cc8ebd16f6ca95f3cc6a6a6964
This commit is contained in:
parent
0ba898c881
commit
185e3b562a
16 changed files with 258 additions and 219 deletions
|
|
@ -759,11 +759,19 @@ wasm = "plugin.wasm"
|
|||
|
||||
let manifest = PluginManifest::parse_str(toml).unwrap();
|
||||
assert_eq!(
|
||||
manifest.ui.theme_extensions.get("--accent-color").map(String::as_str),
|
||||
manifest
|
||||
.ui
|
||||
.theme_extensions
|
||||
.get("--accent-color")
|
||||
.map(String::as_str),
|
||||
Some("#ff6b6b")
|
||||
);
|
||||
assert_eq!(
|
||||
manifest.ui.theme_extensions.get("--sidebar-width").map(String::as_str),
|
||||
manifest
|
||||
.ui
|
||||
.theme_extensions
|
||||
.get("--sidebar-width")
|
||||
.map(String::as_str),
|
||||
Some("280px")
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,11 +275,6 @@ impl UiWidget {
|
|||
///
|
||||
/// Returns `SchemaError::ValidationError` if validation fails
|
||||
pub fn validate(&self) -> SchemaResult<()> {
|
||||
if self.id.is_empty() {
|
||||
return Err(SchemaError::ValidationError(
|
||||
"Widget id cannot be empty".to_string(),
|
||||
));
|
||||
}
|
||||
if self.target.is_empty() {
|
||||
return Err(SchemaError::ValidationError(
|
||||
"Widget target cannot be empty".to_string(),
|
||||
|
|
|
|||
|
|
@ -331,7 +331,9 @@ impl SchemaValidator {
|
|||
|
||||
pub(crate) fn is_reserved_route(route: &str) -> bool {
|
||||
RESERVED_ROUTES.iter().any(|reserved| {
|
||||
route == *reserved || route.starts_with(&format!("{reserved}/"))
|
||||
route == *reserved
|
||||
|| (route.starts_with(reserved)
|
||||
&& route.as_bytes().get(reserved.len()) == Some(&b'/'))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue