mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-20 07:31:39 +01:00
refactor(kde): converge core/pathext.rs to the shared version
Only the ResolvedPathBuf schema description changes in form: it is now chosen by cfg(target_os = "windows") so the file can be shared; on KDE the text is the same as before, so schema.json is unchanged. Verified: cargo test -p komorebi --lib pathext in komorebi-for-kde, 1 passed 0 failed.
This commit is contained in:
1 parent
f7028485d1
commit
645d843dc7
1 file changed
+7
-1
@@ -137,9 +137,15 @@ impl serde_with::schemars_1::JsonSchemaAs<PathBuf> for ResolvedPathBuf {
|
||||
}
|
||||
|
||||
fn json_schema(_generator: &mut schemars::SchemaGenerator) -> schemars::Schema {
|
||||
// the description is part of the checked-in schemas, which differ per platform
|
||||
#[cfg(target_os = "windows")]
|
||||
let description = "A file system path. Environment variables like %VAR%, $Env:VAR, or $VAR are automatically resolved.";
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
let description = "A file system path. Environment variables like $VAR are automatically resolved.";
|
||||
|
||||
schemars::json_schema!({
|
||||
"type": "string",
|
||||
"description": "A file system path. Environment variables like $VAR are automatically resolved."
|
||||
"description": description
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user