client-core: hoist transcript_fold::{fold_page,raw_seq} out of desktop-app
Both desktop-app's app.rs and the new Android transcript client (RUST.md's I5) need the same page-fold and live-stream resume-cursor logic; per CODE_RULES's "write the logic once" it now lives in client-core alongside fold_event/group_tool_runs instead of being duplicated. desktop-app calls the shared functions; its own copies and their tests moved with them. Also fixes a clippy::collapsible_if in config.rs's percent_decode, found while re-running clippy after this change (let-chains are stable now). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
9a33cb5384
commit
78aff64844
3 files changed
+125
-123
No files matched your search
@@ -78,14 +78,14 @@ fn percent_decode(s: &str) -> String {
|
||||
let mut out = Vec::with_capacity(bytes.len());
|
||||
let mut i = 0;
|
||||
while i < bytes.len() {
|
||||
if bytes[i] == b'%' && i + 2 < bytes.len() {
|
||||
if let Ok(byte) =
|
||||
if bytes[i] == b'%'
|
||||
&& i + 2 < bytes.len()
|
||||
&& let Ok(byte) =
|
||||
u8::from_str_radix(std::str::from_utf8(&bytes[i + 1..i + 3]).unwrap_or(""), 16)
|
||||
{
|
||||
out.push(byte);
|
||||
i += 3;
|
||||
continue;
|
||||
}
|
||||
{
|
||||
out.push(byte);
|
||||
i += 3;
|
||||
continue;
|
||||
}
|
||||
out.push(bytes[i]);
|
||||
i += 1;
|
||||
|
||||
Reference in new issue
Block a user