Skip to main content

teaql_tool_extra/
address.rs

1use teaql_tool_core::Result;
2
3#[derive(Debug, Clone)]
4pub struct AddressTool;
5
6impl AddressTool {
7    pub fn new() -> Self { Self }
8
9    /// A simple mock for address parsing (can be expanded later)
10    pub fn extract_province(&self, address: &str) -> String {
11        if let Some(idx) = address.find("省") {
12            address[0..idx+3].to_string()
13        } else {
14            String::new()
15        }
16    }
17}
18
19impl Default for AddressTool {
20    fn default() -> Self { Self::new() }
21}