fix: end offset

This commit is contained in:
not-elm
2025-08-10 23:43:40 +09:00
parent dd6854b176
commit bbb82a5a00
6 changed files with 707 additions and 32 deletions

View File

@@ -52,7 +52,6 @@ impl ImplApp for BrowserProcessAppBuilder {
let Some(command_line) = command_line else {
return;
};
//TODO: フラグで切り替えるようにする
command_line.append_switch(Some(&"use-mock-keychain".into()));
#[cfg(feature = "debug")]
{

View File

@@ -15,7 +15,7 @@ impl DataResponser {
pub fn prepare(&mut self, data: Vec<u8>, range: &Option<(usize, Option<usize>)>) {
if let Some((start, end)) = range {
self.offset = *start;
self.end_offset = end.unwrap_or(data.len()-1);
self.end_offset = end.unwrap_or(data.len());
self.data = data;
} else {
self.offset = 0;
@@ -40,7 +40,7 @@ impl DataResponser {
return None;
}
let slice = &self.data[start..=end.min(self.data.len()-1)];
let slice = &self.data[start..end.min(self.data.len())];
self.offset += slice.len();
Some(slice)
}