Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

lzma FORMAT_ALONE implementation #5777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 9, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
formatting
  • Loading branch information
arihant2math committed May 8, 2025
commit 74deba8f29cec7a9fc7828cf87a94b7236160909
13 changes: 6 additions & 7 deletions 13 stdlib/src/lzma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ mod _lzma {

fn py_new(cls: PyTypeRef, args: Self::Args, vm: &VirtualMachine) -> PyResult {
if args.format == FORMAT_RAW && args.memlimit.is_some() {
return Err(vm.new_value_error(
"Cannot specify memory limit with FORMAT_RAW".to_string(),
));
return Err(
vm.new_value_error("Cannot specify memory limit with FORMAT_RAW".to_string())
);
}
let memlimit = args.memlimit.unwrap_or(u64::MAX);
let filters = args.filters.unwrap_or(0);
Expand Down Expand Up @@ -327,7 +327,7 @@ mod _lzma {
.map_err(|_| new_lzma_error("Failed to initialize encoder", vm))?)
}
}

fn init_alone(
preset: u32,
filter_specs: Option<Vec<PyObjectRef>>,
Expand All @@ -341,9 +341,8 @@ mod _lzma {
} else {
let options = LzmaOptions::new_preset(preset)
.map_err(|_| new_lzma_error("Failed to initialize encoder", vm))?;
let stream = Stream::new_lzma_encoder(&options).map_err(|_| {
new_lzma_error("Failed to initialize encoder", vm)
})?;
let stream = Stream::new_lzma_encoder(&options)
.map_err(|_| new_lzma_error("Failed to initialize encoder", vm))?;
Ok(stream)
}
}
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.