Skip to content

Commit c718974

Browse files
committed
py/objstr: export str_modulo_format for efficient logging from Rust
1 parent 5e38f62 commit c718974

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

py/objstr.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
#include "py/runtime.h"
3535
#include "py/stackctrl.h"
3636

37-
#if MICROPY_PY_BUILTINS_STR_OP_MODULO
38-
STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_t *args, mp_obj_t dict);
39-
#endif
40-
4137
STATIC mp_obj_t mp_obj_new_bytes_iterator(mp_obj_t str, mp_obj_iter_buf_t *iter_buf);
4238
STATIC NORETURN void bad_implicit_conversion(mp_obj_t self_in);
4339

@@ -1408,7 +1404,7 @@ mp_obj_t mp_obj_str_format(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
14081404
MP_DEFINE_CONST_FUN_OBJ_KW(str_format_obj, 1, mp_obj_str_format);
14091405

14101406
#if MICROPY_PY_BUILTINS_STR_OP_MODULO
1411-
STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_t *args, mp_obj_t dict) {
1407+
mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_t *args, mp_obj_t dict) {
14121408
mp_check_self(mp_obj_is_str_or_bytes(pattern));
14131409

14141410
GET_STR_DATA_LEN(pattern, str, len);

py/objstr.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ mp_obj_t mp_obj_new_str_of_type(const mp_obj_type_t *type, const byte *data, siz
7171
mp_obj_t mp_obj_str_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_in);
7272
mp_int_t mp_obj_str_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags);
7373

74+
#if MICROPY_PY_BUILTINS_STR_OP_MODULO
75+
mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_t *args, mp_obj_t dict);
76+
#endif
77+
7478
const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, size_t self_len,
7579
mp_obj_t index, bool is_slice);
7680
const byte *find_subbytes(const byte *haystack, size_t hlen, const byte *needle, size_t nlen, int direction);

0 commit comments

Comments
 (0)