diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 655a179..bccce29 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -217,6 +217,33 @@ impl QrCode { } + pub fn to_svg_string(&self, border: i32) -> String { + assert!(border >= 0, "Border must be non-negative"); + let mut result: String = String::new(); + result.push_str("\n"); + result.push_str("\n"); + result.push_str(&format!("\n", self.size + border * 2)); + result.push_str("\t\n"); + result.push_str("\t\n"); + result.push_str("\n"); + result + } + + /*---- Private helper methods for constructor: Drawing function modules ----*/ fn draw_function_patterns(&mut self) {