Skip to content

Commit 20a29d2

Browse files
committed
Refactor imports in plot.rs tests for macOS compatibility
Reorganized and added conditional imports to improve clarity and maintain consistent functionality across platforms. This ensures the required dependencies are properly included, particularly handling the macOS-specific conditions.
1 parent 2cb95e6 commit 20a29d2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plotly/src/plot.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,12 @@ impl PartialEq for Plot {
586586
mod tests {
587587
use super::*;
588588
use crate::Scatter;
589-
#[cfg(not(target_os = "macos"))]
590-
use base64::engine::general_purpose;
589+
591590
use serde_json::{json, to_value};
592591
use std::path::PathBuf;
592+
#[cfg(not(target_os = "macos"))]
593+
use {base64::engine::general_purpose, base64::Engine};
594+
593595
fn create_test_plot() -> Plot {
594596
let trace1 = Scatter::new(vec![0, 1, 2], vec![6, 10, 2]).name("trace1");
595597
let mut plot = Plot::new();

0 commit comments

Comments
 (0)