Skip to content

Commit

Permalink
add webcam feature to features combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Jun 12, 2024
1 parent 8691045 commit baf5241
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/features.ua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Command ← {"cargo" "c" "--lib" "--no-default-features"}
Features ← (
{"audio" "tls"}
⊂⟨
{"gif,image,terminal_image" "lsp,raw_mode"}
{"gif,image,terminal_image,webcam" "lsp,raw_mode"}
| {"audio_encode" "gif" "image" "terminal_image" "lsp" "native_sys" "raw_mode"}
⟩ ∊□"all" &args
)
Expand Down
1 change: 1 addition & 0 deletions src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ code:
pub fn error_with_span(&self, span: Span, message: impl ToString) -> UiuaError {
UiuaErrorKind::Run(span.sp(message.to_string()), self.inputs().clone().into()).into()
}
#[allow(dead_code)]
pub(crate) fn error_maybe_span(
&self,
span: Option<&CodeSpan>,
Expand Down
4 changes: 2 additions & 2 deletions src/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1829,11 +1829,11 @@ impl SysOp {
}
SysOp::WebcamCapture => {
let index = env.pop(1)?.as_nat(env, "Webcam index must be an integer")?;
let image = (env.rt.backend)
let _image = (env.rt.backend)
.webcam_capture(index)
.map_err(|e| env.error(e))?;
#[cfg(feature = "image")]
env.push(rgb_image_to_array(image));
env.push(rgb_image_to_array(_image));
#[cfg(not(feature = "image"))]
return Err(env.error("Webcam capture is not supported in this environment"));
}
Expand Down

0 comments on commit baf5241

Please sign in to comment.